m-dropdown.vue
1.5 KB
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
<template>
<div>
<div ref="panel" class="panel" :class="{'hide':!visible}">
<div class="mask" @click="showDropdownM(false)"></div>
<!-- 列表 -->
<div class="list">
<div v-for="(item,index) in navList" :key="item.id" :index="index">
<van-collapse @change="onChangeHandler" v-model="activeNames[index]" v-if="item && item.list && item.list.length > 0">
<van-collapse-item :border="borderBoo" :title="item.name" :name="index">
<div slot="title">
<span :class="{'coll-item-act':index == activeIndex}">{{item.name}}</span>
</div>
<div slot="right-icon">
<div class="icon-wrap">
<div class="plus-icon" :class="{'plus-icon-act':index == activeIndex}"></div>
</div>
</div>
<div @click="onClickHandler(item2)" class="list-item" v-for="item2 in item.list" :key="item2.id">
<div class="arrow-icon"></div>
<div class="txt">{{ item2.name }}</div>
</div>
</van-collapse-item>
</van-collapse>
<div v-else @click="onClickHandler(item)" class="list-item">
{{item.name}}
</div>
</div>
</div>
<!-- 语言 -->
<div v-if="langList && langList.length > 0" class="lang">
<div @click="setLangHandler(item)" class="lang-item pointer" :class="{'lang-item-act':locale==item.value}" v-for="item in langList" :key="item.id">
{{ item.name }}
</div>
</div>
</div>
</div>
</template>
<script src="./m-dropdown.js"></script>
<style lang="scss" scoped>
@import "./m-dropdown.scss";
</style>