antd-vue (數選擇加圖標+treeIcon的配置)==》巨坑,文檔里完全沒有


效果圖:

 

1.代碼部分

 <a-tree-select
            style="width: 100%"
            treeIcon
            :treeData="treeData"
            v-model="value"
            treeCheckable
            :showCheckedStrategy="SHOW_PARENT"
            searchPlaceholder="Please select"
        >
           <template  slot-scope="text" slot="title">
                <a-icon type='cluster'/>
                {{text.value}}
            </template>

        </a-tree-select>

2.數據部分

  

const SHOW_PARENT = TreeSelect.SHOW_PARENT;

  const treeData = [
    {
      
      value: '0-0',
      key: '0-0',
      scopedSlots: {
            title: 'title'
        },
    
      children: [
        {
          title: 'Child Node1',
          value: '0-0-0',
          key: '0-0-0',
            
        },
      ],
    },
    {
      title: 'Node2',
      value: '0-1',
      key: '0-1',
      children: [
        {
          title: 'Child Node3',
          value: '0-1-0',
          key: '0-1-0',
          disabled: true,
        },
        {
          title: 'Child Node4',
          value: '0-1-1',
          key: '0-1-1',
        },
        {
          title: 'Child Node5',
          value: '0-1-2',
          key: '0-1-2',
        },
      ],
    },
  ];

  

 


免責聲明!

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



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