mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
45 lines
676 B
Vue
45 lines
676 B
Vue
<template>
|
|
<n-nimbus-service-layout
|
|
ref="layout"
|
|
:padding-body="false"
|
|
:items="items"
|
|
:header-z-index="3000"
|
|
>
|
|
<router-view />
|
|
</n-nimbus-service-layout>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
provide () {
|
|
return {
|
|
NDocRoot: this
|
|
}
|
|
},
|
|
inject: {
|
|
NEntry: {
|
|
default: null
|
|
}
|
|
},
|
|
beforeRouteUpdate (to, from, next) {
|
|
this.memorizedPath = from ? from.path : null
|
|
next()
|
|
},
|
|
data () {
|
|
return {
|
|
memorizedPath: null
|
|
}
|
|
},
|
|
computed: {
|
|
items () {
|
|
return this.NEntry.items
|
|
}
|
|
},
|
|
methods: {
|
|
resetScrollPosition () {
|
|
this.$refs.layout.scrollTo(0, 0)
|
|
}
|
|
}
|
|
}
|
|
</script>
|