lg_frontend/layouts/default.vue

47 lines
700 B
Vue
Raw Normal View History

2024-08-19 14:26:28 +00:00
<template>
<div>
<nuxt />
</div>
</template>
<script>
import { mapActions, mapState } from 'vuex'
export default {
name: "default",
computed: {
...mapState({
info: state => state.system.info
})
},
2025-04-04 13:43:51 +00:00
watch: {
'$route': {
immediate: true,
deep: true,
handler(to) {
if (to.path.indexOf('login') < 0) {
this.getViewData()
}
}
}
},
2024-08-19 14:26:28 +00:00
created() {
},
methods: {
...mapActions('system', ['setInfo']),
async getViewData () {
if (!this.info) {
const { data } = await this.$get('/api/Home/view');
this.setInfo(data)
}
}
}
}
</script>
<style scoped lang="less">
</style>