无码欧精品亚洲白浆日韩一区_国产精品视频爆乳一区二区_精品一区二区三区高清在线播放_精品亚洲成在人线AV无码

vue Treeselect樹形下拉框之獲取選中節(jié)點(diǎn)的ids和lables操作

發(fā)布時(shí)間:2024-12-30
【相關(guān)學(xué)習(xí)推薦:js視頻教程】
api: https://vue-treeselect.js.org/#events
1.ids: 即value
1.lable: 需要用到方法:@select(node,instanceid) 和 @deselect(node,instanceid)
<template><treeselect ref="drha_efaultmodetree" v-model="drha_efaultmodetree_value" :multiple="true" :options="drha_efaultmodetree_options" :flat="true" :show-count="true" :disable-branch-nodes="true" :searchable="false" @select="drha_efaultmodetree_handleselect" @deselect="drha_efaultmodetree_handledeselect" placeholder=" 請(qǐng)選擇..."/> <p>lables:{{drha_efaultmodetree_lables}}</p> <p>ids:{{drha_efaultmodetree_value}}</p> </template> <script> // import the component import treeselect from '@riophae/vue-treeselect' // import the styles import '@riophae/vue-treeselect/dist/vue-treeselect.css' export default { components: { treeselect }, data() { return { drha_efaultmodetree_value: null, drha_efaultmodetree_lables: [], drha_efaultmodetree_options: [ { id: '1', label: 'fruits', children: [ { id: '1-1', label: 'apple ?', isnew: true, }, { id: '1-2', label: 'grapes ?', }, { id: '1-3', label: 'pear ?', }, { id: '1-4', label: 'strawberry ?', }, { id: 'watermelon', label: 'watermelon ?', } ], }, { id: 'vegetables', label: 'vegetables', children: [ { id: 'corn', label: 'corn ?', }, { id: 'carrot', label: 'carrot ?', }, { id: 'eggplant', label: 'eggplant ?', }, { id: 'tomato', label: 'tomato ?', } ], } ], }; }, mounted: function(){ }, methods: { drha_efaultmodetree_handleselect(node,instanceid){ console.log("select"); this.drha_efaultmodetree_lables.push(node.label); }, drha_efaultmodetree_handledeselect(node,instanceid){ console.log("deselect"); for (let i = 0;i<this.drha_efaultmodetree_lables.length;i ){ if(node.label == this.drha_efaultmodetree_lables[i]){ this.drha_efaultmodetree_lables.splice(i,1); } } }, } };</script>補(bǔ)充知識(shí):vue treeselect 下拉樹選擇 問(wèn)題總結(jié)
情況:
解決方法:
截圖:
問(wèn)題二:只能選擇最小分類
如圖:
問(wèn)題三:顯示 分類的個(gè)數(shù)
相關(guān)學(xué)習(xí)推薦:編程視頻
上一個(gè):埃及空運(yùn)阿斯旺國(guó)際機(jī)場(chǎng)介紹,查詢
下一個(gè):東方網(wǎng)力智能安防社區(qū)系統(tǒng)破解萬(wàn)億智慧社區(qū)痛點(diǎn)

專業(yè)英語(yǔ)貨代相關(guān)詞匯(獸醫(yī)專業(yè)英語(yǔ)??荚~匯)
國(guó)際物流代理有限公司國(guó)際物流貨運(yùn)代理公司
風(fēng)速傳感器功能介紹
正置金相顯微鏡在使用時(shí)最害怕發(fā)生的事情
為什么電機(jī)馬達(dá)是現(xiàn)代工業(yè)中常見(jiàn)的動(dòng)力源?
網(wǎng)站用云服務(wù)器提供商服務(wù)
大慶pe包裝機(jī)-pvc熱收縮機(jī)價(jià)格
了解石墨消解儀的技術(shù)參數(shù)
苗圃逐步用機(jī)械替代人工
物流知識(shí)個(gè)人郵寄國(guó)際快遞流程及注意事項(xiàng)