qymh / vue-router-invoke-webpack-plugin Goto Github PK
View Code? Open in Web Editor NEWAutomatic generate the routes of vue-router based on the file directory.
License: MIT License
Automatic generate the routes of vue-router based on the file directory.
License: MIT License
15.7.1
to 15.7.2
.This version is covered by your current version range and after updating it in your project the build failed.
vue-loader is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
生成的./.invoke/router.js里,是不是只要export routes就可以了,new Router的操作让使用者自行实现会不会更合理一点。毕竟这个插件的主要功能在于自动生成路由配置表,而实例化路由对象,大部分使用者或多或少都有一些特殊化的需求,比如我现在就需要在new Router时定义base选项,但插件好像并没有提供这个定义base选项功能,而且把路由守卫这种业务代码写在构建代码里,总感觉怪怪的。
Describe the bug
在meta中经常会配置一些Boolean类型的值,比如 hideInMenu
,目前的话只能由用户去处理字符串,将其转换成需要的类型
Version
vue-router-invoke-webpack-plugin
: 0.4.0
webpack
: 4.29.6
node
: 10.16.0
system
: mac
Code
example:
meta:
- title: 'xxx'
- hideInMenu: false
- noCache: true
now:
// router.js
{
// ...
meta:{title:'xxx',hideInMenu:'false',noCache:'true',}
}
expect:
// router.js
{
// ...
meta: {title: 'xxx',hideInMenu:false,noCache:true,}
}
然后我自己提供了一个简易的方案:
function handleKeyValueType(key = '', value = '') {
const type = typeof value;
switch (type) {
case 'object':
return `${key}: ${JSON.stringify(value)},`;
case 'string':
return `${key}: '${value}',`;
default:
return `${key}: ${value},`;
}
}
// ...
if (item.meta) {
this.routeString += `meta:{`;
for (const meta of item.meta) {
for (const key in meta) {
this.routeString += handleKeyValueType(key, meta[key]);
}
}
this.routeString += `},`;
}
感觉覆盖的方面不太全面。
可以康康有没有更好的解决方式。
Version
vue-router-invoke-webpack-plugin
: 0.4.1
webpack-cli
: 3.3.10
node
: 10.15.3
system
: windows
** The tree of files or Screenshots**
[example of tree]
src
├── views
│ ├── Login
│ │ └── Index.vue
│ │ └── Style.scss
│ └── User
│ ├── Account
│ │ └── Index.vue
│ ├── Home
│ │ └── Index.vue
│ └── Index.vue
3.3.2
to 3.3.3
.This version is covered by your current version range and after updating it in your project the build failed.
webpack-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 201 commits.
173d11a
chore: v.3.3.3
7071b5c
misc: update internal docs
69f7683
chore: monorepo version update
efe8c2a
chore: update jest snapshots
12a38be
chore: monorepo version update
2608179
chore: lockfile updates
25c6e7b
chore: v.3.2.2 until mnorepo versioning
67b3dc7
chore: update utils version for init pkg
ace0d4a
chore: monorepo version update
5c8c6a1
misc: add lerna publish cmnd
16079a1
chore: lerna independent
b9711e8
chore: sec fixes
9b78911
chore: sec patch monorepo
d577b0c
chore: v.3.3.3
4b08819
Merge pull request #925 from anshumanv/prettier/format
There are 201 commits in total.
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
4.35.3
to 4.36.0
.This version is covered by your current version range and after updating it in your project the build failed.
webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
append
option now supports the default placeholders in addition to [url]
"..."
when overriding options.The new version differs by 42 commits.
95d21bb
4.36.0
aa1216c
Merge pull request #9422 from webpack/feature/dot-dot-dot-merge
b3ec775
improve merging of resolve and parsing options
53a5ae2
Merge pull request #9419 from vankop/remove-valid-jsdoc-rule
ab75240
Merge pull request #9413 from webpack/dependabot/npm_and_yarn/ajv-6.10.2
0bdabf4
Merge pull request #9418 from webpack/dependabot/npm_and_yarn/eslint-plugin-jsdoc-15.5.2
f207cdc
remove valid jsdoc rule in favour of eslint-plugin-jsdoc
31333a6
chore(deps-dev): bump eslint-plugin-jsdoc from 15.3.9 to 15.5.2
036adf0
Merge pull request #9417 from webpack/dependabot/npm_and_yarn/eslint-plugin-jest-22.8.0
37d4480
Merge pull request #9411 from webpack/dependabot/npm_and_yarn/simple-git-1.121.0
ce2a183
chore(deps-dev): bump eslint-plugin-jest from 22.7.2 to 22.8.0
0beeb7e
Merge pull request #9391 from vankop/create-hash-typescript
bf1a24a
#9391 resolve super call discussion
bd7d95b
#9391 resolve discussions, AbstractMethodError
4190638
chore(deps): bump ajv from 6.10.1 to 6.10.2
There are 42 commits in total.
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Describe the bug
A clear and concise description of what the bug is.
Version
vue-router-invoke-webpack-plugin
:
webpack
:
node
:
system
: [windows or mac]
** The tree of files or Screenshots**
[example of tree]
![image](https://user-images.githubusercontent.com/43059503/75351849-c0948200-58e3-11ea-8b10-53adc034595a.png)
Describe the bug
多层嵌套路由下,定义一个父路由,其子路由的子路由嵌套失败。
Version
vue-router-invoke-webpack-plugin
:0.3.0
webpack
:4.28.4
node
:8.15.1
system
: MacOS
** The tree of files or Screenshots**
[example of tree]
src
├── views
│ └── layout
│ ├── blog
│ │ ├── Blog.vue
│ │ └── css
│ │ └── Index.vue
│ └── Layout.vue
Describe the bug
引用 0.4.1 版本启动 vue 项目会出现 Cannot find module 'js-beautify'
Version
vue-router-invoke-webpack-plugin
: 0.4.1
webpack
:
node
:
system
: [windows or mac]
** The tree of files or Screenshots**
Error: Cannot find module 'js-beautify'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (vue-demo/node_modules/vue-router-invoke-webpack-plugin/core/files.js:6:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
Describe the bug
restful 风格路由中,路由参数怎么配?
export default new Router({
routes: [
{
name: 'M1',
component: Product,
path: '/product/:id',
meta: {
title: '商品详情'
}
}
]
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.