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 | 1 | <template> |
| 2 | - <transition name="slide-up"> | |
| 2 | + <collapse-transition> | |
| 3 | 3 | <ul :class="classes" v-show="visible"> |
| 4 | 4 | <li> |
| 5 | 5 | <span :class="arrowClasses" @click="handleExpand"> |
| 6 | 6 | <Icon type="arrow-right-b"></Icon> |
| 7 | 7 | </span> |
| 8 | 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 | 14 | <span :class="titleClasses" v-html="data.title" @click="handleSelect"></span> |
| 15 | 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 | 22 | </Tree-node> |
| 23 | 23 | </li> |
| 24 | 24 | </ul> |
| 25 | - </transition> | |
| 25 | + </collapse-transition> | |
| 26 | 26 | </template> |
| 27 | 27 | <script> |
| 28 | 28 | import Checkbox from '../checkbox/checkbox.vue'; |
| 29 | 29 | import Icon from '../icon/icon.vue'; |
| 30 | + import CollapseTransition from '../base/collapse-transition'; | |
| 30 | 31 | import Emitter from '../../mixins/emitter'; |
| 31 | 32 | import { findComponentsDownward } from '../../utils/assist'; |
| 32 | 33 | |
| ... | ... | @@ -35,7 +36,7 @@ |
| 35 | 36 | export default { |
| 36 | 37 | name: 'TreeNode', |
| 37 | 38 | mixins: [ Emitter ], |
| 38 | - components: { Checkbox, Icon }, | |
| 39 | + components: { Checkbox, Icon, CollapseTransition }, | |
| 39 | 40 | props: { |
| 40 | 41 | data: { |
| 41 | 42 | type: Object, | ... | ... |