xiangpei
2025-05-13 4c4995771ce83925a2d69dedc11c4404d9b77875
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
<template>
  <div class="box">
    <!-- 顶部栏 -->
    <navbar @selected="selected" :pagetype="pagetype" />
 
    <component :is="layout[name]"></component>
  </div>
</template>
<script>
import layout from "./index";
import navbar from "./navbar";
export default {
  components: {
    navbar
  },
 
  data() {
    return {
      layout, // 装修模块
      name: "index", // 装修的页面
      pagetype: "INDEX",
    };
  },
  mounted() {
    if (this.$route.query.pagetype == "ALERT") {
      this.name = "alertAdvertising";
    }
    if (this.$route.query.pagetype == "OPEN_SCREEN_ANIMATION") {
      this.name = "advertising";
    }
    this.pagetype = this.$route.query.pagetype;
  },
  methods: {
    selected(val) {
      // 顶部栏点击切换
      this.name = val;
    }
  }
};
</script>
<style scoped lang="scss">
.box {
  height: calc(100vh - 120px);
  width: 98%;
  margin: 0 auto;
  padding: 0 20px;
  background: #fff;
  border-radius: 0.4em;
  overflow: hidden;
}
</style>