1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
| <template>
| <!--
| 作者:luoyiming
| 时间:2019-10-24
| 描述:后台母版
| -->
| <div :class="hasChild != null ? 'main' : 'main right-big'">
| <!--left menu-->
| <LeftMenu @selectMenu="selectMenuFunc"></LeftMenu>
|
| <!--right content-->
| <RightContent></RightContent>
| </div>
| </template>
|
| <script>
| import LeftMenu from '@/views/layout/LeftMenu.vue';
| import RightContent from '@/views/layout/RightContent.vue';
| import store from '@/store/';
| import {delCookie} from '@/utils/base.js';
| export default {
| components: {
| /*左菜单组件*/
| LeftMenu,
| /*右边内容容器*/
| RightContent
| },
| data() {
| return {
| /*是否有子菜单*/
| hasChild: null,
| /*系统基本数据*/
| baseInfo: {
| shop_name: '',
| user: {},
| version: ''
| }
| };
| },
| provide: function() {
| return {
| baseInfo: this.baseInfo
| };
| },
| created() {
| if(this.$route.query.from&&this.$route.query.from=='admin'){
| delCookie('baseInfo');
| }
|
| this.getBaseInof();
| },
| methods: {
| /*左边子组件传来的参数*/
| selectMenuFunc(param) {
| this.hasChild = param;
| },
|
| async getBaseInof() {
| let res = await store.dispatch('common/getBaseInfo');
| this.baseInfo.shop_name = res.shop_name;
| this.baseInfo.version = res.version;
| this.baseInfo.user = res.user;
| }
| }
| };
| </script>
|
| <style></style>
|
|