Commit 2584f87d by 姜雷

修改异步加载时可能还未渲染出dom的报错

parent 226614a4
import Vue from 'vue'; import Vue from 'vue';
import Router from 'vue-router'; import Router from 'vue-router';
import Home from './containers/Home.vue'; // import Home from './containers/Home.vue';
import DatePicker from './containers/DatePicker.vue'; // import DatePicker from './containers/DatePicker.vue';
import SearchItem from './containers/SearchItem.vue'; import SearchItem from './containers/SearchItem.vue';
import Pagination from './containers/Pagination.vue'; import Pagination from './containers/Pagination.vue';
import Dialog from './containers/Dialog.vue'; import Dialog from './containers/Dialog.vue';
...@@ -13,18 +13,23 @@ import layoutIcon from '../src/assets/images/menu/home.png'; ...@@ -13,18 +13,23 @@ import layoutIcon from '../src/assets/images/menu/home.png';
Vue.use(Router); Vue.use(Router);
export const routerMap = [ export const routerMap = [
{ path: '/', name: 'Home', component: Home, meta: { title: '首页' } }, {
path: '/',
name: 'Home',
component: () => import('./containers/Home.vue'),
meta: { title: '首页' },
},
{ {
path: '/home2', path: '/home2',
name: 'HomeT', name: 'HomeT',
component: Home, component: () => import('./containers/Home.vue'),
hidden: true, hidden: true,
meta: { title: '首页' }, meta: { title: '首页' },
}, },
{ {
path: '/DatePicker', path: '/DatePicker',
name: 'DatePicker', name: 'DatePicker',
component: DatePicker, component: () => import('./containers/DatePicker.vue'),
meta: { title: '时间选择' }, meta: { title: '时间选择' },
}, },
{ {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"name": "rym-element-ui", "name": "rym-element-ui",
"version": "0.1.25", "version": "0.1.26",
"description": "任意门组件库", "description": "任意门组件库",
"main": "lib/rymUi.common.js", "main": "lib/rymUi.common.js",
"scripts": { "scripts": {
......
...@@ -83,12 +83,14 @@ export default { ...@@ -83,12 +83,14 @@ export default {
moveToCurrentTag() { moveToCurrentTag() {
const tags = this.$refs.tag; const tags = this.$refs.tag;
this.$nextTick(() => { this.$nextTick(() => {
if (tags && tags.length) {
for (const tag of tags) { for (const tag of tags) {
if (tag.to === this.$route.path) { if (tag.to === this.$route.path) {
this.$refs.scrollPane.moveToTarget(tag.$el); this.$refs.scrollPane.moveToTarget(tag.$el);
break; break;
} }
} }
}
}); });
}, },
closeSelectedTag(view) { closeSelectedTag(view) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment