Commit eae3e936c8a7822416eb83a5514698ff92c05238
1 parent
b80c48ff
Tree support transition
Showing
1 changed file
with
15 additions
and
14 deletions
Show diff stats
src/components/tree/node.vue
1 | <template> | 1 | <template> |
2 | - <transition name="slide-up"> | 2 | + <collapse-transition> |
3 | <ul :class="classes" v-show="visible"> | 3 | <ul :class="classes" v-show="visible"> |
4 | <li> | 4 | <li> |
5 | <span :class="arrowClasses" @click="handleExpand"> | 5 | <span :class="arrowClasses" @click="handleExpand"> |
6 | <Icon type="arrow-right-b"></Icon> | 6 | <Icon type="arrow-right-b"></Icon> |
7 | </span> | 7 | </span> |
8 | <Checkbox | 8 | <Checkbox |
9 | - v-if="showCheckbox" | ||
10 | - :value="data.checked" | ||
11 | - :indeterminate="indeterminate" | ||
12 | - :disabled="data.disabled || data.disableCheckbox" | ||
13 | - @click.native.prevent="handleCheck"></Checkbox> | 9 | + v-if="showCheckbox" |
10 | + :value="data.checked" | ||
11 | + :indeterminate="indeterminate" | ||
12 | + :disabled="data.disabled || data.disableCheckbox" | ||
13 | + @click.native.prevent="handleCheck"></Checkbox> | ||
14 | <span :class="titleClasses" v-html="data.title" @click="handleSelect"></span> | 14 | <span :class="titleClasses" v-html="data.title" @click="handleSelect"></span> |
15 | <Tree-node | 15 | <Tree-node |
16 | - v-for="item in data.children" | ||
17 | - :key="item" | ||
18 | - :data="item" | ||
19 | - :visible="data.expand" | ||
20 | - :multiple="multiple" | ||
21 | - :show-checkbox="showCheckbox"> | 16 | + v-for="item in data.children" |
17 | + :key="item" | ||
18 | + :data="item" | ||
19 | + :visible="data.expand" | ||
20 | + :multiple="multiple" | ||
21 | + :show-checkbox="showCheckbox"> | ||
22 | </Tree-node> | 22 | </Tree-node> |
23 | </li> | 23 | </li> |
24 | </ul> | 24 | </ul> |
25 | - </transition> | 25 | + </collapse-transition> |
26 | </template> | 26 | </template> |
27 | <script> | 27 | <script> |
28 | import Checkbox from '../checkbox/checkbox.vue'; | 28 | import Checkbox from '../checkbox/checkbox.vue'; |
29 | import Icon from '../icon/icon.vue'; | 29 | import Icon from '../icon/icon.vue'; |
30 | + import CollapseTransition from '../base/collapse-transition'; | ||
30 | import Emitter from '../../mixins/emitter'; | 31 | import Emitter from '../../mixins/emitter'; |
31 | import { findComponentsDownward } from '../../utils/assist'; | 32 | import { findComponentsDownward } from '../../utils/assist'; |
32 | 33 | ||
@@ -35,7 +36,7 @@ | @@ -35,7 +36,7 @@ | ||
35 | export default { | 36 | export default { |
36 | name: 'TreeNode', | 37 | name: 'TreeNode', |
37 | mixins: [ Emitter ], | 38 | mixins: [ Emitter ], |
38 | - components: { Checkbox, Icon }, | 39 | + components: { Checkbox, Icon, CollapseTransition }, |
39 | props: { | 40 | props: { |
40 | data: { | 41 | data: { |
41 | type: Object, | 42 | type: Object, |