javascript - iView中 tree 樹(shù)控件 的方法調(diào)用有錯(cuò)
問(wèn)題描述
官網(wǎng)的說(shuō)明Tree methods
方法名說(shuō)明參數(shù)getCheckedNodes獲取被勾選的節(jié)點(diǎn)無(wú)getSelectedNodes獲取被選中的節(jié)點(diǎn)無(wú)自己擼的代碼----------------------------------
<button @click=’getCheckedNodes’>獲取被選中的節(jié)點(diǎn)</button><button @click='getSelectedNodes'>獲取被勾選的節(jié)點(diǎn)</button>
自己擼的代碼---------------------------
getCheckedNodes(){ console.log(this.$refs.Tree.getCheckedNodes());},getSelectedNodes(){ console.log(this.$refs.tree.getSelectedNodes);}
報(bào)錯(cuò)
App.vue?2573:105 Uncaught TypeError: Cannot read property ’getCheckedNodes’ of undefinedat VueComponent.getCheckedNodes (eval at <anonymous> (app.js:967), <anonymous>:92:40)at boundFn (eval at <anonymous> (app.js:723), <anonymous>:125:14)at HTMLButtonElement.invoker (eval at <anonymous> (app.js:723), <anonymous>:1659:18)
問(wèn)題解答
回答1:Tree組件調(diào)用上面要寫(xiě)上ref
<Tree :data='baseData' show-checkbox ref='tree'></Tree>
相關(guān)文章:
1. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””2. boot2docker無(wú)法啟動(dòng)3. docker-compose中volumes的問(wèn)題4. java - SSH框架中寫(xiě)分頁(yè)時(shí)service層中不能注入分頁(yè)類(lèi)5. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.6. nignx - docker內(nèi)nginx 80端口被占用7. dockerfile - 為什么docker容器啟動(dòng)不了?8. docker images顯示的鏡像過(guò)多,狗眼被亮瞎了,怎么辦?9. docker容器呢SSH為什么連不通呢?10. 關(guān)于docker下的nginx壓力測(cè)試

網(wǎng)公網(wǎng)安備