Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit 77004cc

Browse files
committed
refactor: update package structure
1 parent 23c25ec commit 77004cc

File tree

8 files changed

+74
-30
lines changed

8 files changed

+74
-30
lines changed

packages/@vuetify/presets/generator/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = (api, options) => {
2121
'eslint-plugin-vue': '^6.2.2',
2222
lodash: '^4.17.15',
2323
webfontloader: '^1.6.28',
24+
'vuex-pathify': '^1.4.1',
2425
},
2526
})
2627

packages/@vuetify/presets/generator/templates/base/src/App.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@
55
</template>
66

77
<script>
8-
export default {
9-
name: 'App',
10-
}
8+
export default { name: 'App' }
119
</script>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// https://davestewart.github.io/vuex-pathify/#/setup/config
2+
3+
import pathify from 'vuex-pathify'
4+
5+
// options
6+
pathify.options.mapping = 'simple'
7+
pathify.options.strict = true
8+
9+
export default pathify

packages/@vuetify/presets/generator/templates/base/src/router/index.js

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,28 @@ import Router from 'vue-router'
1010

1111
Vue.use(Router)
1212

13-
export function createRouter () {
14-
return new Router({
15-
mode: 'history',
16-
base: process.env.BASE_URL,
17-
scrollBehavior: (to, from, savedPosition) => {
18-
if (to.hash) return { selector: to.hash }
19-
if (savedPosition) return savedPosition
13+
export default new Router({
14+
mode: 'history',
15+
base: process.env.BASE_URL,
16+
scrollBehavior: (to, from, savedPosition) => {
17+
if (to.hash) return { selector: to.hash }
18+
if (savedPosition) return savedPosition
2019

21-
return { x: 0, y: 0 }
22-
},
23-
routes: [
24-
{
25-
path: '/',
26-
// Layouts allow you to define different
27-
// structures for different view
28-
component: () => import('@/layouts/default'),
29-
children: [
30-
{
31-
path: '',
32-
name: 'Home',
33-
component: () => import('@/views/home'),
34-
},
35-
],
36-
},
37-
],
38-
})
39-
}
20+
return { x: 0, y: 0 }
21+
},
22+
routes: [
23+
{
24+
path: '/',
25+
// Layouts allow you to define different
26+
// structures for different view
27+
component: () => import('@/layouts/default'),
28+
children: [
29+
{
30+
path: '',
31+
name: 'Home',
32+
component: () => import('@/views/Home')
33+
}
34+
]
35+
}
36+
]
37+
})
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Vue
2+
import Vue from 'vue'
3+
import Vuex from 'vuex'
4+
5+
// Utilities
6+
import pathify from '@/plugins/vuex-pathify'
7+
8+
// Modules
9+
import * as modules from './modules'
10+
11+
Vue.use(Vuex)
12+
13+
export default new Vuex.Store({
14+
modules,
15+
plugins: [pathify.plugin]
16+
})
17+
18+
export const ROOT_DISPATCH = Object.freeze({ root: true })
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Pathify
2+
import { make } from 'vuex-pathify'
3+
4+
// Data
5+
const state = {}
6+
7+
const mutations = make.mutations(state)
8+
9+
const actions = make.actions(state)
10+
11+
const getters = {}
12+
13+
export default {
14+
namespaced: true,
15+
state,
16+
mutations,
17+
actions,
18+
getters,
19+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as app } from './app'

packages/@vuetify/presets/generator/templates/base/src/views/home/Index.vue renamed to packages/@vuetify/presets/generator/templates/base/src/views/Home.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
['Webfont Loader', 'mdi-format-size', 'green accent-4'],
126126
],
127127
links: [
128-
['//github.com/vuetifyjs/vuetify', 'Github', 'mdi-github-circle'],
128+
['//github.com/vuetifyjs/vuetify', 'Github', 'mdi-github'],
129129
['//vuetifyjs.com', 'Documentation', 'mdi-file-document'],
130130
['//community.vuetifyjs.com', 'Community', 'mdi-account-multiple'],
131131
['//github.com/users/johnleider/sponsors', 'Support Vuetify', 'mdi-vuetify'],

0 commit comments

Comments
 (0)