提交 26ad216c 编写于 作者: KK's avatar KK

重置事件值抛出

上级 117bbb35
<template> <template>
<van-dropdown-menu :class="showTitle === title?'':'dropdown-menu-ative'" class="ibiz-dropdown-menu"> <van-dropdown-menu :class="showTitle === title?'':'dropdown-menu-ative'" class="ibiz-dropdown-menu">
<van-dropdown-item :title="showTitle" ref="item" > <van-dropdown-item :title="showTitle" ref="item" >
<div class="dropdown-box"> <div class="dropdown-box">
<div v-for="(item,index) in items" :key="index" class="dropdown-item" @click="itemClick(item)"> <div v-for="(item,index) in items" :key="index" class="dropdown-item" @click="itemClick(item)">
<div v-show="selectItem == item" class="dropdown-item-icon"><van-icon name="success" /></div> <div v-show="selectItem == item" class="dropdown-item-icon"><van-icon name="success" /></div>
<div class="dropdown-item-text">{{item.label}}</div> <div class="dropdown-item-text">{{item.label}}</div>
</div> </div>
</div> </div>
<van-button class="dropdown-btn" @click="onReset" >重置</van-button> <van-button class="dropdown-btn" @click="onReset" >重置</van-button>
<van-button class="dropdown-btn" type="info" @click="onConfirm">确定</van-button> <van-button class="dropdown-btn" type="info" @click="onConfirm">确定</van-button>
</van-dropdown-item> </van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -70,6 +70,7 @@ export default class AppVanSelect extends Vue { ...@@ -70,6 +70,7 @@ export default class AppVanSelect extends Vue {
this.selectItem = {}; this.selectItem = {};
this.showTitle = this.title; this.showTitle = this.title;
this.closeDropdown(); this.closeDropdown();
this.$emit('onConfirm',{[this.name]:this.selectItem.value})
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册