| | |
| | | <i class="el-icon-arrow-down"></i> |
| | | </div> |
| | | <!-- 下拉框大盒子 --> |
| | | <div :class="{ 'options-box-show': !optionsShow, 'options-box-hide': optionsShow, issel: options.length >= 4 }" |
| | | class="select-options" :style="{ height: 35 * options.length + 'px' }"> |
| | | <div :class="{ 'options-box-show': !optionsShow && options.length, 'options-box-hide': optionsShow, issel: options.length >= 4 }" |
| | | class="select-options"> |
| | | <!-- 下拉框 --> |
| | | <div @click="cutValue(item, index)" v-for="(item, index) in options" :key="index">{{ item[optionsName] }} |
| | | </div> |
| | | <div @click="cutValue(item, index)" v-for="(item, index) in options" :key="index">{{ item[optionsName] }}</div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | }, |
| | | |
| | | mounted () { |
| | | setTimeout(() => { |
| | | console.log(this.options) |
| | | }, 3000) |
| | | |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | this.$emit("selectCheck", item, index) |
| | | }, |
| | | selectClick () { |
| | | console.log(this.selectAllClass, this.options.length) |
| | | if (this.selectAllClass == true) return |
| | | this.optionsShow = !this.optionsShow |
| | | } |
| | |
| | | <style lang="scss" scoped> |
| | | //显示下拉框 |
| | | .options-box-show { |
| | | display: block; |
| | | display: block !important; |
| | | } |
| | | |
| | | //隐藏下拉框 |
| | | .options-box-hide { |
| | | display: none; |
| | | display: none !important; |
| | | } |
| | | |
| | | //点击时改变选择框的边框颜色 |
| | |
| | | |
| | | //当下拉框数量超过4个时 使用固定高度 |
| | | .issel { |
| | | height: 140px !important; |
| | | max-height: 140px !important; |
| | | } |
| | | |
| | | .select-options { |
| | | display: none; |
| | | width: 100%; |
| | | height: 140px; |
| | | max-height: 140px; |
| | | overflow: auto; |
| | | border: 1px solid rgba(20, 50, 123, 1); //下拉框边框颜色 |
| | | border-top: none; |