m-dropdown.vue 1.5 KB
<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>