Houjie
2025-04-11 1bf977929dd324f3ac64b70debd8a79443c54392
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
<template>
    <view>
        <home :cur="PageCur" v-if="PageCur=='home'" :key="commponent1Key"></home>
        <people v-if="PageCur=='people'" :key="commponent2Key"></people>
        <device v-if="PageCur=='device'" :key="commponent3Key"></device>
        <spare v-if="PageCur=='spare'" :key="commponent4Key"></spare>
        <view class="cu-bar tabbar bg-white shadow foot">
            <view :class="PageCur=='home'?'action text-green':'action text-gray'" @click="NavChange" data-cur="home">
                <view class='cuIcon-homefill'></view>首页
            </view>
            <view :class="PageCur=='device'?'action text-green':'action text-gray'" @click="NavChange" data-cur="device">
                <view class='cuIcon-apps'></view>设备
            </view>
            <view :class="PageCur=='spare'?'action text-green':'action text-gray'" @click="NavChange" data-cur="spare">
                <view class='cuIcon-scan'></view>扫一扫
            </view>
            <view :class="PageCur=='people'?'action text-green':'action text-gray'" @click="NavChange"
                data-cur="people">
                <view class='cuIcon-people'></view>我的
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
 
        data() {
            return {
                PageCur: 'home',
                commponent1Key: 0,
                commponent2Key: 0,
                commponent3Key: 0,
                commponent4Key: 0
 
            }
        },
        onLoad: function() {
            this.PageCur = 'home'
                ++this.commponent1Key
                ++this.commponent2Key
                ++this.commponent3Key
                ++this.commponent4Key
        },
        methods: {
            NavChange: function(e) {
                this.PageCur = e.currentTarget.dataset.cur
            }
 
        }
    }
</script>
 
<style>
 
</style>