Skip to content

Commit 6d06bdd

Browse files
authored
feat: bump vue-auto-routing v0.5.0 (#31)
1 parent 6381376 commit 6d06bdd

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,21 @@ export default [
6868

6969
If you want to make route param required, create a directory for the param and add `index.vue` in the directory. In the above example, if you replace `users/_id.vue` with `users/_id/index.vue`, `:id` param will be required.
7070

71-
#### `<route-meta>` custom block
71+
#### `<route>` custom block
7272

73-
If a page component has `<route-meta>` custom block, the content json will be used as [route meta field](https://router.vuejs.org/guide/advanced/meta.html).
73+
If a page component has `<route>` custom block, the content json will be merged with [route config](https://router.vuejs.org/api/#routes).
7474

75-
For example, if `index.vue` has the following `<route-meta>` block:
75+
For example, if `index.vue` has the following `<route>` block:
7676

7777
```vue
78-
<route-meta>
78+
<route>
7979
{
80-
"requiresAuth": true
80+
"name": "home",
81+
"meta": {
82+
"requiresAuth": true
83+
}
8184
}
82-
</route-meta>
85+
</route>
8386
8487
<template>
8588
<h1>Hello</h1>
@@ -91,7 +94,7 @@ The generated route config is like the following:
9194
```js
9295
module.exports = [
9396
{
94-
name: 'index',
97+
name: 'home',
9598
path: '/',
9699
component: () => import('@/pages/index.vue'),
97100
meta: {

generator/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = (api) => {
44
'vue-router-layout': '^0.1.2',
55
},
66
devDependencies: {
7-
'vue-auto-routing': '^0.4.0',
7+
'vue-auto-routing': '^0.5.0',
88
},
99
vue: {
1010
pluginOptions: {

index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ module.exports = (api, options) => {
2323
.post()
2424
.resourceQuery(/blockType=route-meta/)
2525
.use('route-meta')
26-
.loader('vue-cli-plugin-auto-routing/route-meta-loader')
26+
.loader('vue-cli-plugin-auto-routing/route-loader')
27+
28+
// prettier-ignore
29+
webpackConfig.module
30+
.rule('route')
31+
.post()
32+
.resourceQuery(/blockType=route/)
33+
.use('route')
34+
.loader('vue-cli-plugin-auto-routing/route-loader')
2735
})
2836
}
File renamed without changes.

0 commit comments

Comments
 (0)