li-guang
2020-12-15 eb49240e16e3c1c2b560e975b9ff8fdd68bc760d
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
<template>
    <!-- 知识库 -->
    <view>
        <scroll-view class="list-left" scroll-y>
            <view v-for="(item,index) in list" @click="show(item)">
                {{item.primaryTitle}}
                <view v-for="sub in item.subTitle" v-show="item.isShow">
                    {{sub}}
                </view>
            </view>
        </scroll-view>
        <scroll-view class="list-right"></scroll-view>
    </view>
</template>
 
<script>
    export default{
        data(){
            return{
                primaryTitle:['院装产品','美容套餐','美容客装','美容试装'],
                subTitle:['院装产品','院装产品','院装产品','院装产品'],
                list:[
                    {
                        primaryTitle:'院装产品',
                        subTitle:['院装产品','院装产品','院装产品','院装产品'],
                        isShow:false
                    },
                    {
                        primaryTitle:'美容套餐',
                        subTitle:['美容套餐','美容套餐','美容套餐','美容套餐'],
                        isShow:false
                    }
                ],
            }
        },
        methods:{
            show(item){
                item.isShow=!item.isShow
            }
        }
    }
</script>
 
<style>
    .list-left{
        width: 100px;
    }
</style>