select下拉框组件
1、在父组件引入select组件
<selec :sele="sele" :isSeleDiv="isSeleDiv" v-on:isBool="isBool" />
2、在父组件引入select组件路径
import selec from './Select'
3、事件处理代码
export default {
components: {
selec
},
data () {
return {
// option中的数据
sele: ["111","222","333","444"],
// 下拉框的显示隐藏值
isSeleDiv: false
}
},
methods: {
// 点击显示隐藏下拉框
isBool () {
this.isSeleDiv = !this.isSeleDiv
}
}
}
select组件代码
<template>
<div class="select">
<!-- input框 -->
<div class="selectDiv" ref="selectDiv" @click="onSelectDiv" >
<div class="selectDiv_inp">
<input type="text" v-model="inputValue" disabled="true" >
</div>
<!-- 箭头旋转图片 -->
<div class="selectDiv_icon">
<svg :class="[rotate?'go':'aa']" t="1590832124447" class="icon"