From 4c1af63c91868780beea73758a8c50840893d35d Mon Sep 17 00:00:00 2001 From: jiaming <743192023@qq.com> Date: Mon, 17 Dec 2018 16:48:57 +0800 Subject: [PATCH] set scrollnav --- src/router/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/router/index.js b/src/router/index.js index 566f0da..4301634 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -13,6 +13,13 @@ const View = r => require.ensure([], () => r(require('../views/dataView/index.vu Vue.use(Router) export default new Router({ + scrollBehavior (to, from, savedPosition) { + if (to.hash) { + return { + selector: to.hash + } + } + }, routes: [ { path: '/demo',