Blame view

examples/routers/tree.vue 1.14 KB
89f2ba8b   梁灏   init Tree component
1
  <template>
9d79a51f   梁灏   update Tree
2
3
4
5
      <div>
          <Tree :data="baseData" show-checkbox></Tree>
          <div @click="c">change</div>
      </div>
89f2ba8b   梁灏   init Tree component
6
7
8
  </template>
  <script>
      export default {
e6c0b158   梁灏   update
9
          data () {
e81207a2   梁灏   update Tree
10
              return {
e6c0b158   梁灏   update
11
                  baseData: [{
ce03ac52   梁灏   update Tree
12
                      expand: true,
e81207a2   梁灏   update Tree
13
                      title: 'parent 1',
ce03ac52   梁灏   update Tree
14
                      children: [{
e81207a2   梁灏   update Tree
15
16
17
                          title: 'parent 1-0',
                          expand: true,
                          disabled: true,
ce03ac52   梁灏   update Tree
18
                          children: [{
e81207a2   梁灏   update Tree
19
20
21
22
23
24
25
                              title: 'leaf',
                              disableCheckbox: true
                          }, {
                              title: 'leaf',
                          }]
                      }, {
                          title: 'parent 1-1',
e6c0b158   梁灏   update
26
                          expand: true,
e81207a2   梁灏   update Tree
27
                          checked: true,
ce03ac52   梁灏   update Tree
28
                          children: [{
e6c0b158   梁灏   update
29
                              title: '<span style="color: red">leaf</span>'
e81207a2   梁灏   update Tree
30
31
32
33
                          }]
                      }]
                  }]
              }
9d79a51f   梁灏   update Tree
34
35
36
37
38
          },
          methods: {
              c () {
                  this.baseData[0].expand = false;
              }
e81207a2   梁灏   update Tree
39
40
41
          }
      }
  </script>