# routertoview

Latest version **1.0.2** (published 2024-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install routertoview
pnpm add routertoview
yarn add routertoview
bun add routertoview
```

Provides the command `setup`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-02-23 |
| First published | 2022-06-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | hrsdef |
| Keywords | vue3, ts, component |

## Links

- npm: https://www.npmjs.com/package/routertoview
- Repository: https://github.com/hrsdef/routertoview
- Homepage: https://github.com/hrsdef/routertoview#readme
- Issues: https://github.com/hrsdef/routertoview/issues
- npm.io page: https://npm.io/package/routertoview

## Dependencies (2)

- [ejs](https://npm.io/package/ejs.md) ^3.1.8
- [commander](https://npm.io/package/commander.md) ^9.3.0

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2024-02-23
- 1.0.1 — 2022-06-14
- 1.0.0 — 2022-06-14

## README

# 说明文档
## `routerToview`: 一个快速搭建vue3+ts路由视图映射工具


如何安装？

```shell
npm install routerToview -g
```

## 创建项目

目前支持Vue3+ts项目





## 项目开发

项目开发目前提供两个功能：

* 创建Vue组件
* 创建Vue页面，并配置路由




### 创建Vue组件：

````shell
setup addcpn YourComponentName # 例如coderwhy add NavBar，默认会存放到src/components文件夹中
setup addcpn YourComponentName -d src/pages/home # 也可以指定存放的具体文件夹
````





为什么会创建router.js文件：

* `router.js`文件是路由的其中一个配置；
* 创建该文件中 `src/router/index.js`中会自动加载到路由的 `routes`配置中，不需要手动配置了（如果是自己配置的文件夹需要手动配置）

`src/router/index.js`中已经完成如下操作：

```js
// 动态加载pages中所有的路由文件示例
const files = require.context('@/pages', true, /router\.js$/);
const routes = files.keys().map(key => {
  const page = require('@/pages' + key.replace('.', ''));
  return page.default;
})
```

---
_Source: https://npm.io/package/routertoview · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
