mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
43 lines
694 B
Vue
43 lines
694 B
Vue
<template>
|
|
<n-service-layout
|
|
ref="layout"
|
|
:padding-body="false"
|
|
:items="items"
|
|
:sider-props="siderProps"
|
|
>
|
|
<router-view />
|
|
</n-service-layout>
|
|
</template>
|
|
|
|
<script>
|
|
import { useDocOptions } from '../../store'
|
|
|
|
export default {
|
|
provide () {
|
|
return {
|
|
NDocRoot: this
|
|
}
|
|
},
|
|
beforeRouteUpdate (to, from, next) {
|
|
this.memorizedPath = from ? from.path : null
|
|
next()
|
|
},
|
|
setup () {
|
|
return {
|
|
items: useDocOptions(),
|
|
memorizedPath: null,
|
|
siderProps: {
|
|
style: {
|
|
height: '100%'
|
|
}
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
resetScrollPosition () {
|
|
this.$refs.layout.scrollTo(0, 0)
|
|
}
|
|
}
|
|
}
|
|
</script>
|