Commit e6c0b158e9e86a4687da559fe7048b2aa0dcb73f

Authored by 梁灏
1 parent de517e39

update

update
src/components/checkbox/checkbox.vue
@@ -81,10 +81,13 @@ @@ -81,10 +81,13 @@
81 }, 81 },
82 mounted () { 82 mounted () {
83 // todo 使用 while向上查找 83 // todo 使用 while向上查找
84 - if (this.$parent && this.$parent.$options.name === 'checkboxGroup') this.group = true; 84 + if (this.$parent && this.$parent.$options.name === 'CheckboxGroup') this.group = true;
85 if (!this.group) { 85 if (!this.group) {
86 this.updateModel(); 86 this.updateModel();
87 - if (this.$refs.slot && this.$refs.slot.innerHTML === '') { 87 +// if (this.$refs.slot && this.$refs.slot.innerHTML === '') {
  88 +// this.showSlot = false;
  89 +// }
  90 + if (this.$slots.default === undefined) {
88 this.showSlot = false; 91 this.showSlot = false;
89 } 92 }
90 } 93 }
src/components/radio/radio.vue
@@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
64 }, 64 },
65 mounted () { 65 mounted () {
66 // todo 使用 while向上查找 66 // todo 使用 while向上查找
67 - if (this.$parent && this.$parent.$options.name === 'radioGroup') this.group = true; 67 + if (this.$parent && this.$parent.$options.name === 'RadioGroup') this.group = true;
68 if (!this.group) { 68 if (!this.group) {
69 this.updateValue(); 69 this.updateValue();
70 } 70 }
src/components/rate/rate.vue
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 // }, 81 // },
82 currentValue: { 82 currentValue: {
83 immediate: true, 83 immediate: true,
84 - handler (val) { 84 + handler () {
85 this.setHalf(this.currentValue); 85 this.setHalf(this.currentValue);
86 } 86 }
87 } 87 }
src/components/tree/tree.vue
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 :value="item.checked && item.childrenCheckedStatus == 2" 9 :value="item.checked && item.childrenCheckedStatus == 2"
10 :disabled="item.disabled || item.disableCheckbox" 10 :disabled="item.disabled || item.disableCheckbox"
11 :indeterminate="item.checked && item.childrenCheckedStatus == 1" 11 :indeterminate="item.checked && item.childrenCheckedStatus == 1"
12 - @click.prevent="setCheck(item.disabled||item.disableCheckbox, index)"></Checkbox> 12 + @click.native.prevent="setCheck(item.disabled||item.disableCheckbox, index)"></Checkbox>
13 <a :class="titleCls(item)" @click="setSelect(item.disabled, index)"> 13 <a :class="titleCls(item)" @click="setSelect(item.disabled, index)">
14 <span :class="[prefixCls + '-title']" v-html="item.title"></span> 14 <span :class="[prefixCls + '-title']" v-html="item.title"></span>
15 </a> 15 </a>
@@ -181,7 +181,7 @@ @@ -181,7 +181,7 @@
181 this.dispatch('Tree', 'nodeSelected', { 181 this.dispatch('Tree', 'nodeSelected', {
182 ori: this, 182 ori: this,
183 selected: selected 183 selected: selected
184 - }) 184 + });
185 } 185 }
186 }, 186 },
187 setCheck (disabled, index) { 187 setCheck (disabled, index) {
src/styles/components/tree.less
@@ -91,7 +91,7 @@ @@ -91,7 +91,7 @@
91 transition: all @transition-time @ease-in-out; 91 transition: all @transition-time @ease-in-out;
92 } 92 }
93 &.@{tree-prefix-cls}-switcher-noop { 93 &.@{tree-prefix-cls}-switcher-noop {
94 - display: none; 94 + //display: none;
95 cursor: auto; 95 cursor: auto;
96 i{ 96 i{
97 display: none; 97 display: none;
test/routers/tree.vue
1 <template> 1 <template>
2 - <div>  
3 - <Tree  
4 - v-model="treeData"  
5 - :show-checkbox="true"  
6 - :multiple="true"  
7 - @on-select-change="selectFn"  
8 - @on-check-change="checkFn"></Tree>  
9 - </div> 2 + <Tree v-model="baseData" show-checkbox></Tree>
10 </template> 3 </template>
11 <script> 4 <script>
12 export default { 5 export default {
13 - data: function() { 6 + data () {
14 return { 7 return {
15 - treeData: [{ 8 + baseData: [{
16 expand: true, 9 expand: true,
17 title: 'parent 1', 10 title: 'parent 1',
18 - selected: false,  
19 children: [{ 11 children: [{
20 title: 'parent 1-0', 12 title: 'parent 1-0',
21 expand: true, 13 expand: true,
@@ -28,21 +20,14 @@ @@ -28,21 +20,14 @@
28 }] 20 }]
29 }, { 21 }, {
30 title: 'parent 1-1', 22 title: 'parent 1-1',
  23 + expand: true,
31 checked: true, 24 checked: true,
32 children: [{ 25 children: [{
33 - title: '<span style="color: red">sss</span>', 26 + title: '<span style="color: red">leaf</span>'
34 }] 27 }]
35 }] 28 }]
36 }] 29 }]
37 } 30 }
38 - },  
39 - methods: {  
40 - selectFn(data){  
41 - console.log(data);  
42 - },  
43 - checkFn(data){  
44 - console.log(data);  
45 - }  
46 } 31 }
47 } 32 }
48 </script> 33 </script>