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