diff --git a/vuetify-test/.browserslistrc b/Yi.Vue/.browserslistrc similarity index 100% rename from vuetify-test/.browserslistrc rename to Yi.Vue/.browserslistrc diff --git a/vuetify-test/.env.development b/Yi.Vue/.env.development similarity index 100% rename from vuetify-test/.env.development rename to Yi.Vue/.env.development diff --git a/vuetify-test/.env.production b/Yi.Vue/.env.production similarity index 100% rename from vuetify-test/.env.production rename to Yi.Vue/.env.production diff --git a/vuetify-test/.gitignore b/Yi.Vue/.gitignore similarity index 100% rename from vuetify-test/.gitignore rename to Yi.Vue/.gitignore diff --git a/vuetify-test/README.md b/Yi.Vue/README.md similarity index 100% rename from vuetify-test/README.md rename to Yi.Vue/README.md diff --git a/vuetify-test/package-lock.json b/Yi.Vue/package-lock.json similarity index 99% rename from vuetify-test/package-lock.json rename to Yi.Vue/package-lock.json index 340655b2..49231f16 100644 --- a/vuetify-test/package-lock.json +++ b/Yi.Vue/package-lock.json @@ -1517,6 +1517,11 @@ "supports-color": "^5.3.0" } }, + "chartist": { + "version": "0.11.4", + "resolved": "https://registry.npm.taobao.org/chartist/download/chartist-0.11.4.tgz", + "integrity": "sha1-6W4cVz2LZ0eJIKOmrlI1nZ/I2Lc=" + }, "check-types": { "version": "8.0.3", "resolved": "https://registry.npm.taobao.org/check-types/download/check-types-8.0.3.tgz", @@ -8814,6 +8819,14 @@ "resolved": "https://registry.npmmirror.com/vue/download/vue-2.6.14.tgz", "integrity": "sha1-5RqlJQJQ1Wmj+606ilpofWA24jU=" }, + "vue-chartist": { + "version": "2.3.1", + "resolved": "https://registry.npm.taobao.org/vue-chartist/download/vue-chartist-2.3.1.tgz", + "integrity": "sha1-dDlL7E2Dg8UjeAPlTC735/P69IQ=", + "requires": { + "chartist": "^0.11.0" + } + }, "vue-cli-plugin-vuetify": { "version": "2.4.2", "resolved": "https://registry.nlark.com/vue-cli-plugin-vuetify/download/vue-cli-plugin-vuetify-2.4.2.tgz", diff --git a/vuetify-test/package.json b/Yi.Vue/package.json similarity index 94% rename from vuetify-test/package.json rename to Yi.Vue/package.json index 5ea323bb..a5c5c396 100644 --- a/vuetify-test/package.json +++ b/Yi.Vue/package.json @@ -9,6 +9,7 @@ "dependencies": { "axios": "^0.22.0", "vue": "^2.6.11", + "vue-chartist": "^2.3.1", "vue-router": "^3.2.0", "vuetify": "^2.4.0" }, diff --git a/vuetify-test/public/favicon.ico b/Yi.Vue/public/favicon.ico similarity index 100% rename from vuetify-test/public/favicon.ico rename to Yi.Vue/public/favicon.ico diff --git a/vuetify-test/public/index.html b/Yi.Vue/public/index.html similarity index 68% rename from vuetify-test/public/index.html rename to Yi.Vue/public/index.html index bc514658..db55c39e 100644 --- a/vuetify-test/public/index.html +++ b/Yi.Vue/public/index.html @@ -1,19 +1,22 @@ - + + - <%= htmlWebpackPlugin.options.title %> + Yi-Vue - - + + +
- - + + + \ No newline at end of file diff --git a/Yi.Vue/src/App.vue b/Yi.Vue/src/App.vue new file mode 100644 index 00000000..706a0b0b --- /dev/null +++ b/Yi.Vue/src/App.vue @@ -0,0 +1,23 @@ + + + diff --git a/Yi.Vue/src/assets/clint-mckoy.jpg b/Yi.Vue/src/assets/clint-mckoy.jpg new file mode 100644 index 00000000..6e23b7b8 Binary files /dev/null and b/Yi.Vue/src/assets/clint-mckoy.jpg differ diff --git a/Yi.Vue/src/assets/lock.jpg b/Yi.Vue/src/assets/lock.jpg new file mode 100644 index 00000000..6e5d4c0a Binary files /dev/null and b/Yi.Vue/src/assets/lock.jpg differ diff --git a/Yi.Vue/src/assets/login.jpg b/Yi.Vue/src/assets/login.jpg new file mode 100644 index 00000000..52b905a7 Binary files /dev/null and b/Yi.Vue/src/assets/login.jpg differ diff --git a/vuetify-test/src/assets/logo.png b/Yi.Vue/src/assets/logo.png similarity index 100% rename from vuetify-test/src/assets/logo.png rename to Yi.Vue/src/assets/logo.png diff --git a/vuetify-test/src/assets/logo.svg b/Yi.Vue/src/assets/logo.svg similarity index 100% rename from vuetify-test/src/assets/logo.svg rename to Yi.Vue/src/assets/logo.svg diff --git a/Yi.Vue/src/assets/pricing.jpg b/Yi.Vue/src/assets/pricing.jpg new file mode 100644 index 00000000..df49d3fa Binary files /dev/null and b/Yi.Vue/src/assets/pricing.jpg differ diff --git a/Yi.Vue/src/assets/register.jpg b/Yi.Vue/src/assets/register.jpg new file mode 100644 index 00000000..94d234cf Binary files /dev/null and b/Yi.Vue/src/assets/register.jpg differ diff --git a/Yi.Vue/src/assets/vmd.svg b/Yi.Vue/src/assets/vmd.svg new file mode 100644 index 00000000..0bdb0a1d --- /dev/null +++ b/Yi.Vue/src/assets/vmd.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Yi.Vue/src/assets/vuetify.svg b/Yi.Vue/src/assets/vuetify.svg new file mode 100644 index 00000000..4ef7bd53 --- /dev/null +++ b/Yi.Vue/src/assets/vuetify.svg @@ -0,0 +1 @@ +Artboard 47 diff --git a/Yi.Vue/src/components/Links.vue b/Yi.Vue/src/components/Links.vue new file mode 100644 index 00000000..e30c4182 --- /dev/null +++ b/Yi.Vue/src/components/Links.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/Yi.Vue/src/components/MaterialAlert.vue b/Yi.Vue/src/components/MaterialAlert.vue new file mode 100644 index 00000000..2397fc92 --- /dev/null +++ b/Yi.Vue/src/components/MaterialAlert.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/Yi.Vue/src/components/MaterialCard.vue b/Yi.Vue/src/components/MaterialCard.vue new file mode 100644 index 00000000..c8002d5f --- /dev/null +++ b/Yi.Vue/src/components/MaterialCard.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/Yi.Vue/src/components/MaterialChartCard.vue b/Yi.Vue/src/components/MaterialChartCard.vue new file mode 100644 index 00000000..4049201e --- /dev/null +++ b/Yi.Vue/src/components/MaterialChartCard.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/Yi.Vue/src/components/MaterialSnackbar.vue b/Yi.Vue/src/components/MaterialSnackbar.vue new file mode 100644 index 00000000..2801d97c --- /dev/null +++ b/Yi.Vue/src/components/MaterialSnackbar.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/Yi.Vue/src/components/MaterialStatsCard.vue b/Yi.Vue/src/components/MaterialStatsCard.vue new file mode 100644 index 00000000..f1322d15 --- /dev/null +++ b/Yi.Vue/src/components/MaterialStatsCard.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/vuetify-test/src/components/Table.vue b/Yi.Vue/src/components/Table.vue similarity index 99% rename from vuetify-test/src/components/Table.vue rename to Yi.Vue/src/components/Table.vue index 2379c6d6..717133dc 100644 --- a/vuetify-test/src/components/Table.vue +++ b/Yi.Vue/src/components/Table.vue @@ -102,6 +102,7 @@ diff --git a/Yi.Vue/src/components/app/BarItem.vue b/Yi.Vue/src/components/app/BarItem.vue new file mode 100644 index 00000000..fe36dfb6 --- /dev/null +++ b/Yi.Vue/src/components/app/BarItem.vue @@ -0,0 +1,29 @@ + diff --git a/Yi.Vue/src/components/app/Btn.vue b/Yi.Vue/src/components/app/Btn.vue new file mode 100644 index 00000000..8de14054 --- /dev/null +++ b/Yi.Vue/src/components/app/Btn.vue @@ -0,0 +1,22 @@ + + + diff --git a/Yi.Vue/src/components/app/Card.vue b/Yi.Vue/src/components/app/Card.vue new file mode 100644 index 00000000..d8dd5ff7 --- /dev/null +++ b/Yi.Vue/src/components/app/Card.vue @@ -0,0 +1,12 @@ + + + diff --git a/Yi.Vue/src/components/app/Tabs.vue b/Yi.Vue/src/components/app/Tabs.vue new file mode 100644 index 00000000..16df63af --- /dev/null +++ b/Yi.Vue/src/components/app/Tabs.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/Yi.Vue/src/layouts/default/AppBar.vue b/Yi.Vue/src/layouts/default/AppBar.vue new file mode 100644 index 00000000..9c70b1f6 --- /dev/null +++ b/Yi.Vue/src/layouts/default/AppBar.vue @@ -0,0 +1,79 @@ + + + diff --git a/Yi.Vue/src/layouts/default/Drawer.vue b/Yi.Vue/src/layouts/default/Drawer.vue new file mode 100644 index 00000000..e26819c6 --- /dev/null +++ b/Yi.Vue/src/layouts/default/Drawer.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/Yi.Vue/src/layouts/default/Footer.vue b/Yi.Vue/src/layouts/default/Footer.vue new file mode 100644 index 00000000..5feef9dd --- /dev/null +++ b/Yi.Vue/src/layouts/default/Footer.vue @@ -0,0 +1,22 @@ + + + diff --git a/Yi.Vue/src/layouts/default/Index.vue b/Yi.Vue/src/layouts/default/Index.vue new file mode 100644 index 00000000..6f54715f --- /dev/null +++ b/Yi.Vue/src/layouts/default/Index.vue @@ -0,0 +1,42 @@ + + + diff --git a/vuetify-test/src/components/List.vue b/Yi.Vue/src/layouts/default/List.vue similarity index 99% rename from vuetify-test/src/components/List.vue rename to Yi.Vue/src/layouts/default/List.vue index cbccd6d2..e81b0751 100644 --- a/vuetify-test/src/components/List.vue +++ b/Yi.Vue/src/layouts/default/List.vue @@ -24,10 +24,12 @@ diff --git a/Yi.Vue/src/layouts/default/widgets/Account.vue b/Yi.Vue/src/layouts/default/widgets/Account.vue new file mode 100644 index 00000000..953d43d9 --- /dev/null +++ b/Yi.Vue/src/layouts/default/widgets/Account.vue @@ -0,0 +1,59 @@ + + + diff --git a/Yi.Vue/src/layouts/default/widgets/AccountSettings.vue b/Yi.Vue/src/layouts/default/widgets/AccountSettings.vue new file mode 100644 index 00000000..bf5d48cd --- /dev/null +++ b/Yi.Vue/src/layouts/default/widgets/AccountSettings.vue @@ -0,0 +1,39 @@ + + + diff --git a/Yi.Vue/src/layouts/default/widgets/DrawerHeader.vue b/Yi.Vue/src/layouts/default/widgets/DrawerHeader.vue new file mode 100644 index 00000000..11c58559 --- /dev/null +++ b/Yi.Vue/src/layouts/default/widgets/DrawerHeader.vue @@ -0,0 +1,29 @@ + + + diff --git a/Yi.Vue/src/layouts/default/widgets/DrawerToggle.vue b/Yi.Vue/src/layouts/default/widgets/DrawerToggle.vue new file mode 100644 index 00000000..9e6d1a57 --- /dev/null +++ b/Yi.Vue/src/layouts/default/widgets/DrawerToggle.vue @@ -0,0 +1,27 @@ + + + diff --git a/Yi.Vue/src/layouts/default/widgets/GoHome.vue b/Yi.Vue/src/layouts/default/widgets/GoHome.vue new file mode 100644 index 00000000..60b54a2b --- /dev/null +++ b/Yi.Vue/src/layouts/default/widgets/GoHome.vue @@ -0,0 +1,17 @@ + + + diff --git a/Yi.Vue/src/layouts/default/widgets/Notifications.vue b/Yi.Vue/src/layouts/default/widgets/Notifications.vue new file mode 100644 index 00000000..bb05867e --- /dev/null +++ b/Yi.Vue/src/layouts/default/widgets/Notifications.vue @@ -0,0 +1,62 @@ + + + diff --git a/Yi.Vue/src/layouts/default/widgets/Search.vue b/Yi.Vue/src/layouts/default/widgets/Search.vue new file mode 100644 index 00000000..a90982aa --- /dev/null +++ b/Yi.Vue/src/layouts/default/widgets/Search.vue @@ -0,0 +1,31 @@ + + + diff --git a/vuetify-test/src/main.js b/Yi.Vue/src/main.js similarity index 92% rename from vuetify-test/src/main.js rename to Yi.Vue/src/main.js index 86ab9ba5..7d3cd181 100644 --- a/vuetify-test/src/main.js +++ b/Yi.Vue/src/main.js @@ -2,7 +2,7 @@ import Vue from 'vue' import App from './App.vue' import router from './router' import vuetify from './plugins/vuetify' - +import './plugins' Vue.config.productionTip = false new Vue({ diff --git a/Yi.Vue/src/plugins/app.js b/Yi.Vue/src/plugins/app.js new file mode 100644 index 00000000..740a6f5f --- /dev/null +++ b/Yi.Vue/src/plugins/app.js @@ -0,0 +1,20 @@ +/** + * plugins/app.js + * + * Automatically loads and bootstraps files + * in the `./src/components/` folder. + */ + +// Imports +import Vue from 'vue' + +const requireComponent = require.context('@/components', true, /\.vue$/) + +for (const file of requireComponent.keys()) { + const componentConfig = requireComponent(file) + + Vue.component( + componentConfig.default.name, + componentConfig.default || componentConfig, + ) +} diff --git a/Yi.Vue/src/plugins/chartist.js b/Yi.Vue/src/plugins/chartist.js new file mode 100644 index 00000000..2c8bb2d9 --- /dev/null +++ b/Yi.Vue/src/plugins/chartist.js @@ -0,0 +1,4 @@ +import Vue from 'vue' +import 'chartist/dist/chartist.min.css' + +Vue.use(require('vue-chartist')) diff --git a/Yi.Vue/src/plugins/index.js b/Yi.Vue/src/plugins/index.js new file mode 100644 index 00000000..e65178ed --- /dev/null +++ b/Yi.Vue/src/plugins/index.js @@ -0,0 +1,6 @@ +// Automatically included in './src/main.js' + +import './app' +import './chartist' +// import './webfontloader' +// import './vue-meta' \ No newline at end of file diff --git a/Yi.Vue/src/plugins/vuetify.js b/Yi.Vue/src/plugins/vuetify.js new file mode 100644 index 00000000..8634eeef --- /dev/null +++ b/Yi.Vue/src/plugins/vuetify.js @@ -0,0 +1,30 @@ +// Vuetify Documentation https://vuetifyjs.com + +import Vue from 'vue' +import Vuetify from 'vuetify/lib/framework' +import ripple from 'vuetify/lib/directives/ripple' + +Vue.use(Vuetify, { directives: { ripple } }) + +const theme = { + primary: '#E91E63', + secondary: '#9C27b0', + accent: '#e91e63', + info: '#00CAE3', + success: '#4CAF50', + warning: '#FB8C00', + error: '#FF5252', +} + +export default new Vuetify({ + breakpoint: { mobileBreakpoint: 960 }, + icons: { + values: { expand: 'mdi-menu-down' }, + }, + theme: { + themes: { + dark: theme, + light: theme, + }, + }, +}) \ No newline at end of file diff --git a/Yi.Vue/src/router/index.js b/Yi.Vue/src/router/index.js new file mode 100644 index 00000000..70370c64 --- /dev/null +++ b/Yi.Vue/src/router/index.js @@ -0,0 +1,29 @@ +import Vue from 'vue' +import VueRouter from 'vue-router' +import { trailingSlash } from '@/util/helpers' +import { + layout, + route, +} from '@/util/routes' +Vue.use(VueRouter) + + + +const router = new VueRouter({ + mode: 'history', + base: process.env.BASE_URL, + scrollBehavior: (to, from, savedPosition) => { + if (to.hash) return { selector: to.hash } + if (savedPosition) return savedPosition + + return { x: 0, y: 0 } + }, + routes: [layout('Default', [ + route('Dashboard'), + route('UserProfile', null, 'components/profile'), + ])] +}) +router.beforeEach((to, from, next) => { + return to.path.endsWith('/') ? next() : next(trailingSlash(to.path)) +}) +export default router \ No newline at end of file diff --git a/Yi.Vue/src/styles/overrides.sass b/Yi.Vue/src/styles/overrides.sass new file mode 100644 index 00000000..5755ee53 --- /dev/null +++ b/Yi.Vue/src/styles/overrides.sass @@ -0,0 +1,26 @@ +.text-mono + font-family: monospace + +// Helpers +.flex-1-1-auto + flex: 1 1 auto !important + +.flex-1-0-auto + flex: 1 0 auto !important + +.flex-0-1-auto + flex: 0 1 auto !important + +.flex-0-0-auto + flex: 0 0 auto !important + +.position-relative + position: relative !important + +.overflow-y-scroll + overflow-y: scroll + +table + > thead > tr > th, + > tbody > tr > td + font-weight: 300 !important diff --git a/Yi.Vue/src/styles/variables.scss b/Yi.Vue/src/styles/variables.scss new file mode 100644 index 00000000..3a6131f7 --- /dev/null +++ b/Yi.Vue/src/styles/variables.scss @@ -0,0 +1,106 @@ +// reduce button default elevation +// default background color is #EEEEEE + +$btn-sizes: ( + 'small': 28, + 'default': 41, + 'large': 54 +); + +$btn-font-sizes: ( + 'default': .75rem +); + +$btn-font-weight: 400; +$btn-letter-spacing: normal; +$material-light: ( + 'background': #EEEEEE, + 'text': ( + 'primary': #333333, + 'secondary': #999999 + ) +); +$btn-icon-font-size: 1.0625rem !important; + +$list-item-min-height: 48px; + +$blockquote-font-size: 1.25rem; + +$card-border-radius: 6px; +$card-text-font-weight: 300; +$card-elevation: 1; + +$data-table-regular-header-font-size: 1.0625rem; + +$shadow-key-umbra: ( + 1: (0 1px 4px 0 rgba(0,0,0,.14)), + 12: (0 16px 38px -12px rgba(0,0,0,.56)) +); + +$shadow-key-penumbra: ( + 1: (0 0 0 0 rgba(0,0,0,0)), + 12: (0 4px 25px 0 rgba(0,0,0,.12)) +); + +$shadow-key-ambient: ( + 1: (0 0 0 0 rgba(0,0,0,0)), + 12: (0 8px 10px -5px rgba(0,0,0,.2)) +); + +$headings: ( + 'h1': ( + 'size': 3.3125rem, + 'line-height': 1.15em, + 'weight': 300 + ), + 'h2': ( + 'size': 2.25rem, + 'line-height': 1.5em, + 'weight': 300 + ), + 'h3': ( + 'size': 1.5625rem, + 'line-height': 1.4em, + 'weight': 300 + ), + 'h4': ( + 'size': 1.125rem, + 'line-height': 1.4em, + 'weight': 300 + ), + 'h5': ( + 'size': 1.0625rem, + 'line-height': 1.4em, + 'weight': 300 + ), + 'h6': ( + 'size': .75rem, + 'line-height': 1.5em, + 'text-transform': uppercase, + 'weight': 500 + ), + 'subtitle-1': ( + 'size': 0.875rem, + 'weight': 300 + ), + 'subtitle-2': ( + 'size': 0.875rem, + 'line-height': 1.5em !important, + 'weight': 300 + ), + 'caption': ( + 'size': 0.8125rem, + 'weight': 300 + ), + 'overline': ( + 'letter-spacing': normal, + 'line-height': 0.625rem, + 'size': 0.625rem, + 'weight': 500 + ) +); + +// Tabs +$tab-font-size: .775rem; +$tab-font-weight: 500; +$tabs-item-letter-spacing: normal; diff --git a/vuetify-test/src/utils/dialog.js b/Yi.Vue/src/util/dialog.js similarity index 100% rename from vuetify-test/src/utils/dialog.js rename to Yi.Vue/src/util/dialog.js diff --git a/Yi.Vue/src/util/globals.js b/Yi.Vue/src/util/globals.js new file mode 100644 index 00000000..71bb7cff --- /dev/null +++ b/Yi.Vue/src/util/globals.js @@ -0,0 +1,11 @@ +const EN_LOCALE_ONLY = process.env.EN_LOCALE_ONLY === 'true' +const IN_BROWSER = typeof window !== 'undefined' +const IS_DEBUG = process.env.DEBUG === 'true' +const IS_PROD = process.env.NODE_ENV === 'production' + +module.exports = { + EN_LOCALE_ONLY, + IN_BROWSER, + IS_DEBUG, + IS_PROD, +} diff --git a/Yi.Vue/src/util/helpers.js b/Yi.Vue/src/util/helpers.js new file mode 100644 index 00000000..fbfb09d5 --- /dev/null +++ b/Yi.Vue/src/util/helpers.js @@ -0,0 +1,11 @@ +export function leadingSlash (str) { + return str.startsWith('/') ? str : '/' + str +} + +export function trailingSlash (str) { + return str.endsWith('/') ? str : str + '/' +} + +export const wait = timeout => { + return new Promise(resolve => setTimeout(resolve, timeout)) +} diff --git a/vuetify-test/src/utils/myaction.js b/Yi.Vue/src/util/myaction.js similarity index 100% rename from vuetify-test/src/utils/myaction.js rename to Yi.Vue/src/util/myaction.js diff --git a/vuetify-test/src/utils/myaxios.js b/Yi.Vue/src/util/myaxios.js similarity index 73% rename from vuetify-test/src/utils/myaxios.js rename to Yi.Vue/src/util/myaxios.js index 8a774726..ce37c36b 100644 --- a/vuetify-test/src/utils/myaxios.js +++ b/Yi.Vue/src/util/myaxios.js @@ -25,12 +25,12 @@ myaxios.interceptors.response.use(function(response) { return resp; }, function(error) { const resp = error.response.data - if (resp.code == undefined && resp.msg == undefined) { - alert(`错误代码:无,原因:与服务器失去连接`) - } else if (resp.code != 200) { - alert(`错误代码:${resp.code},原因:${resp.msg}`) - } - // store.dispatch("closeLoad"); + // if (resp.code == undefined && resp.msg == undefined) { + // alert(`错误代码:无,原因:与服务器失去连接`) + // } else if (resp.code != 200) { + // alert(`错误代码:${resp.code},原因:${resp.msg}`) + // } + // store.dispatch("closeLoad"); return Promise.reject(error); }); export default myaxios \ No newline at end of file diff --git a/vuetify-test/src/utils/myqq.js b/Yi.Vue/src/util/myqq.js similarity index 100% rename from vuetify-test/src/utils/myqq.js rename to Yi.Vue/src/util/myqq.js diff --git a/Yi.Vue/src/util/routes.js b/Yi.Vue/src/util/routes.js new file mode 100644 index 00000000..00a2e3a1 --- /dev/null +++ b/Yi.Vue/src/util/routes.js @@ -0,0 +1,76 @@ +// Imports +import { kebabCase } from 'lodash' +import { leadingSlash, trailingSlash } from '@/util/helpers' + +export function abort(code = 404) { + return { + name: 'FourOhFour', + path: '*', + component: () => error(code), + } +} + +export function error(code = 404) { + return import ( + /* webpackChunkName: "error-[request]" */ + `@/views/${code}.vue` + ) +} + +export function layout(layout = 'Default', children, path = '') { + const dir = kebabCase(layout) + + return { + children, + component: () => + import ( + /* webpackChunkName: "layout-[request]" */ + `@/layouts/${dir}/Index` + ), + path, + } +} + +export function redirect( + path = '*', + rhandler, +) { + if (typeof path === 'function') { + rhandler = path + path = '*' + } + + return { + path, + redirect: to => { + const rpath = rhandler(to) + const url = rpath !== '' ? + leadingSlash(trailingSlash(rpath)) : + rpath + + return `/${url}` + }, + } +} + +export function route(name, component, path = '') { + component = Object(component) === component ? + component : + { default: name.replace(' ', '') } + + const components = {} + + for (const [key, value] of Object.entries(component)) { + components[key] = () => + import ( + /* webpackChunkName: "views-[request]" */ + `@/views/${value}` + ) + } + + return { + name, + components, + path, + } +} \ No newline at end of file diff --git a/vuetify-test/src/utils/signalR.js b/Yi.Vue/src/util/signalR.js similarity index 100% rename from vuetify-test/src/utils/signalR.js rename to Yi.Vue/src/util/signalR.js diff --git a/vuetify-test/src/utils/usertoken.js b/Yi.Vue/src/util/usertoken.js similarity index 100% rename from vuetify-test/src/utils/usertoken.js rename to Yi.Vue/src/util/usertoken.js diff --git a/vuetify-test/src/components/HelloWorld.vue b/Yi.Vue/src/views/Dashboard.vue similarity index 88% rename from vuetify-test/src/components/HelloWorld.vue rename to Yi.Vue/src/views/Dashboard.vue index c93ec62f..c9c0f2c6 100644 --- a/vuetify-test/src/components/HelloWorld.vue +++ b/Yi.Vue/src/views/Dashboard.vue @@ -1,23 +1,15 @@ diff --git a/vuetify-test/src/plugins/vuetify.js b/vuetify-test/src/plugins/vuetify.js deleted file mode 100644 index 5bdec19d..00000000 --- a/vuetify-test/src/plugins/vuetify.js +++ /dev/null @@ -1,7 +0,0 @@ -import Vue from 'vue'; -import Vuetify from 'vuetify/lib/framework'; - -Vue.use(Vuetify); - -export default new Vuetify({ -}); diff --git a/vuetify-test/src/router/index.js b/vuetify-test/src/router/index.js deleted file mode 100644 index f46228b4..00000000 --- a/vuetify-test/src/router/index.js +++ /dev/null @@ -1,31 +0,0 @@ -import Vue from 'vue' -import VueRouter from 'vue-router' -import Home from '../views/Home.vue' - -Vue.use(VueRouter) - -const routes = [{ - path: '/', - name: 'Home', - component: Home - - }, - { - path: '/about', - name: 'About', - // route level code-splitting - // this generates a separate chunk (about.[hash].js) for this route - // which is lazy-loaded when the route is visited. - component: function() { - return import ( /* webpackChunkName: "about" */ '../views/About.vue') - } - } -] - -const router = new VueRouter({ - mode: 'history', - base: process.env.BASE_URL, - routes -}) - -export default router \ No newline at end of file diff --git a/vuetify-test/src/views/About.vue b/vuetify-test/src/views/About.vue deleted file mode 100644 index 3fa28070..00000000 --- a/vuetify-test/src/views/About.vue +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/vuetify-test/src/views/Home.vue b/vuetify-test/src/views/Home.vue deleted file mode 100644 index 636303a6..00000000 --- a/vuetify-test/src/views/Home.vue +++ /dev/null @@ -1,15 +0,0 @@ - - -