优化体验

This commit is contained in:
aixianling
2022-04-27 19:36:32 +08:00
parent 861e7c688f
commit bd512c3caa
9 changed files with 29 additions and 3480 deletions

View File

@@ -44,7 +44,7 @@ export default {
return (this.apps || []).filter(e => !this.search || reg.test(e.name) || reg.test(e.label))
},
selectedApp() {
return this.$route.name != "产品库"
return this.$route?.name != "产品库"
},
login() {
let url = '/auth/oauth/token';

23
examples/main.js Normal file
View File

@@ -0,0 +1,23 @@
import Vue from 'vue';
import App from './App.vue';
import ui from 'element-ui';
import router from './router/router';
import axios from './router/axios';
import utils from './utils';
import vcUI from 'dvcp-ui';
import 'dvcp-ui/lib/styles/common.scss';
import 'dvcp-ui/lib/dvcp-ui.css';
import store from './store';
Vue.use(ui);
Vue.use(vcUI);
//富文本编辑器配置
Vue.config.productionTip = false;
Vue.prototype.$axios = axios;
Vue.prototype.formatContent = (val) => val.replace(/(\r\n)|(\n)/g, '<br>');
Object.keys(utils).map((e) => (Vue.prototype[e] = utils[e]));
new Vue({
router,
store,
render: (h) => h(App)
}).$mount('#app');

View File

@@ -1,7 +1,7 @@
import store from "../store";
import appEntry from "../views/appEntry";
import {waiting} from "../utils";
import router from "./router";
export default {
routes: [],
init() {
@@ -31,6 +31,7 @@ export default {
}
//命名规范入口文件必须以App开头
waiting.setContent(`加载${name}...`)
router.addRoute(addApp)
this.routes.push(addApp)
return store.commit("addApp", addApp)
})

View File

@@ -1,22 +1,18 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import autoRoutes from './autoRoutes'
import Vue from "vue";
autoRoutes.init()
Vue.use(VueRouter)
export default autoRoutes.init().then(() => new VueRouter({
export default new VueRouter({
mode: 'history',
hashbang: false,
routes: [
{path: "/", name: "产品库"},
...autoRoutes.routes
],
routes: [{path: "/", name: "产品库",component:import('../App')}],
scrollBehavior(to) {
console.log(to)
if (to.hash) {
return {
selector: to.hash
}
}
}
}))
})

View File

@@ -75,6 +75,8 @@ export const waiting = {
div.style.zIndex = '202204271710'
div.style.textAlign = 'center'
div.style.lineHeight = '100vh'
div.style.color = '#26f'
div.style.background = 'rgba(0,0,0,.8)'
document.body.appendChild(div)
} else if (count < 10) {
setTimeout(() => this.init(ops, ++count), 500)