diff --git a/examples/docs/upload.md b/examples/docs/upload.md index a7944b066..5cada3040 100644 --- a/examples/docs/upload.md +++ b/examples/docs/upload.md @@ -39,7 +39,7 @@ ::: demo 通过 slot 你可以传入自定义的上传按钮类型和文字提示。 ```html - + 点击上传
只能上传jpg/png文件,且不超过500kb
@@ -65,7 +65,7 @@ ::: demo 将 `type` 属性指定为 'drag' 可以将上传控件变为支持拖拽的形式,并且你可以通过 `multiple` 属性来控制是否支持多选,`on-preview` 和 `on-remove` 是一个钩子函数,分别在点击上传后的文件链接和点击移除上传后的文件后被调用。 ```html { + if (savedPosition) { + // savedPosition is only available for popstate navigations. + return savedPosition; + } else { + // new navigation. + // scroll to anchor + if (to.hash) { + return { anchor: true }; + } + // explicitly control scroll position + // check if any matched route config has meta that requires scrolling to top + if (to.matched.some(m => m.meta.scrollToTop)) { + return { x: 0, y: 0 }; + } + } +}; + const router = new VueRouter({ + mode: 'history', base: __dirname, + scrollBehavior, routes: configRouter }); diff --git a/examples/pages/component.vue b/examples/pages/component.vue index 6826a9f97..103c23d70 100644 --- a/examples/pages/component.vue +++ b/examples/pages/component.vue @@ -5,33 +5,41 @@ .el-col { box-sizing: border-box; } - .page-component .content > { - h3 { - margin: 45px 0 15px; - } - table { - width: 100%; - background-color: #fff; - color: #5e6d82; - font-size: 14px; - margin-bottom: 45px; + .page-component { + .content { + padding-left: 25px; + border-left: 1px solid #eaeefa; + margin-left: -1px; - strong { - font-weight: normal; - } - th { - text-align: left; - } - td, th { - border-bottom: 1px solid #eaeefb; - padding: 10px 0; + > { + h3 { + margin: 45px 0 15px; + } + table { + width: 100%; + background-color: #fff; + color: #5e6d82; + font-size: 14px; + margin-bottom: 45px; + + strong { + font-weight: normal; + } + th { + text-align: left; + } + td, th { + border-bottom: 1px solid #eaeefb; + padding: 10px 0; + } + } } } }