0
点赞
收藏
分享

微信扫一扫

VUE-实现点击input显示弹出区域,点其他地方关闭的功能

代码:

<div class="table-page-search-wrapper" @click="handleBlur">
<a-form @keyup.enter.native="handleRefresh" layout="inline">
<a-row :gutter="48">
<a-col
:xxl="GLOBAL.fcols.xxl"
:xl="GLOBAL.fcols.xl"
:lg="GLOBAL.fcols.lg"
:md="GLOBAL.fcols.md"
:sm="GLOBAL.fcols.sm"
>
<a-form-item label="特殊组件">
<a-input
v-model="queryParam.vo.components"
@click.stop="handleFocus"
/>
<div class="epc-i-v" v-if="selectUI" @click.stop>
<div v-for="(list, index) in selectMaps" :key="index">
<a-form-item :label="list.label">
<a-radio-group v-model="selectValues[list.code]">
<a-radio :value="true">是</a-radio>
<a-radio :value="false">否</a-radio>
</a-radio-group>
</a-form-item>
</div>
</div>
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
handleBlur() {
this.selectUI = false;
},
handleFocus() {
this.selectUI = true;
},

注意:

1.需要用到@click.stop,不能用focus代替

2.关键点是@click.stop方法,显示区域需要加stop禁用

举报

相关推荐

0 条评论