el-cascader 设置选中任意一级


  <el-form-item label="地址:" prop="FRegionId">
                        <el-cascader ref="refRegion" :options="CityRegionOption" v-model="FRegionId" @@change="FRegionchange"
                                     :props="{ checkStrictly: true }"
                                     clearable></el-cascader>
                    </el-form-item>
 watch: {
                handlerValue() {                   
                    if (this.$refs.refRegion) {
                        this.$refs.refRegion.dropDownVisible = false; //监听值发生变化就关闭它
                    }
                }
            },
            mounted() {
                setInterval(function () {
                    document.querySelectorAll('.el-cascader-node__label').forEach(el => {
                        el.onclick = function () {
                            if (this.previousElementSibling) this.previousElementSibling.click()
                        }
                    })
                }, 1000)
            },

源文:

https://www.cnblogs.com/listen9436/p/12304268.html
https://www.cnblogs.com/whoamimy/p/12488790.html

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM