ann0707
2018-08-16 c9bc8ec61cff4076132f6396d99d383a2cdf5a03
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
<template>
    <footer class="f-footer">
        <tabbar>
            <tabbar-item @on-item-click="handlerItemClick" :selected="selectIndex === 0" link="/iosnewsHome">
                <i slot="icon" class="iconfont icon-home"></i>
                <i slot="icon-active" class="iconfont icon-home-fill"></i>
                <span slot="label">首页</span>
            </tabbar-item>
            <tabbar-item @on-item-click="handlerItemClick" :selected="selectIndex === 1" link="/iosmine">
                <i slot="icon" class="iconfont icon-my"></i>
                <i slot="icon-active" class="iconfont icon-my-fill"></i>
                <span slot="label">我的</span>
            </tabbar-item>
        </tabbar>
    </footer>
</template>
 
<script>
    /**
     * Created by c.y on 2018/3/20.
     * 组件的命名 项目名(F---filean) + 组件的描述(区别与框架的组件)
     * IOS上架的全局的footer
     * selectIndex number类型 选中的那个tab
     */
    import {Tabbar, TabbarItem} from 'vux'
 
    export default {
        name: 'f-footer',
        data() {
            return {
                selectIndex: 0
            }
        },
        components: {
            Tabbar,
            TabbarItem,
        },
        methods: {
            handlerItemClick(index) {
                this.selectIndex = index;
            }
        },
        props: {
            index: {
                type: Number,
                default: 0
            }
        },
        activated: function () {
            this.selectIndex = this.index;
        }
    }
</script>
 
<style lang="less">
    .f-footer {
        .iconfont {
            font-size: 24PX;
        }
    }
</style>