ant-design-vue/components/tree/demo/directory.md
2018-09-28 14:35:26 +08:00

940 B

#### 目录 内置的目录树,`multiple` 模式支持 `ctrl(Windows)` / `command(Mac)` 复选。 #### Directory Built-in directory tree. `multiple` support `ctrl(Windows)` / `command(Mac)` selection.
<template>
  <a-directory-tree
    multiple
    defaultExpandAll
    @select="onSelect"
    @expand="onExpand"
  >
    <a-tree-node title="parent 0" key="0-0">
      <a-tree-node title="leaf 0-0" key="0-0-0" isLeaf />
      <a-tree-node title="leaf 0-1" key="0-0-1" isLeaf />
    </a-tree-node>
    <a-tree-node title="parent 1" key="0-1">
      <a-tree-node title="leaf 1-0" key="0-1-0" isLeaf />
      <a-tree-node title="leaf 1-1" key="0-1-1" isLeaf />
    </a-tree-node>
  </a-directory-tree>
</template>
<script>
export default {
  methods: {
    onSelect (keys) {
      console.log('Trigger Select', keys);
    },
    onExpand () {
      console.log('Trigger Expand');
    },
  },
}

</script>