vue2.0 組織機構樹形選擇組件(類似elementui 兩個標簽的結合)


1. 效果圖

 

2. 實現:   三級(部門或人員的樹形選擇)

3. 模擬數據說明:  fake.js

  

  name:  顯示的名稱(同時也是源碼中 for 循環單一的key ,  如果真實數據存在名字有重復的情況, 建議加入ID字段作為主鍵)

  type:  department 為部門   human 為個人

  children: 數據類型必須為 數組,   type 為 human 個人時, 值為空數組 [],  為department 部門時   值為對象 或者為空數組

  以上4個鍵為必須, 最多三級嵌套

4. 源碼 https://github.com/IceGogh/vue-components

 

5. 直接引入時, 將父組件的真實數據 通過props方式 傳入  organization組件

  

  5.1.文件位置:

  components/OrganizationTree

 

  5.2. 引入

  import Organ from "@/components/OrganizationTree"

 

  5.3.調用

  <organization-tree dataList:"dataArray"></organization-tree>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM