update
update
This commit is contained in:
parent
de517e39f6
commit
e6c0b158e9
6 changed files with 15 additions and 27 deletions
|
@ -81,10 +81,13 @@
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
// todo 使用 while向上查找
|
// todo 使用 while向上查找
|
||||||
if (this.$parent && this.$parent.$options.name === 'checkboxGroup') this.group = true;
|
if (this.$parent && this.$parent.$options.name === 'CheckboxGroup') this.group = true;
|
||||||
if (!this.group) {
|
if (!this.group) {
|
||||||
this.updateModel();
|
this.updateModel();
|
||||||
if (this.$refs.slot && this.$refs.slot.innerHTML === '') {
|
// if (this.$refs.slot && this.$refs.slot.innerHTML === '') {
|
||||||
|
// this.showSlot = false;
|
||||||
|
// }
|
||||||
|
if (this.$slots.default === undefined) {
|
||||||
this.showSlot = false;
|
this.showSlot = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
// todo 使用 while向上查找
|
// todo 使用 while向上查找
|
||||||
if (this.$parent && this.$parent.$options.name === 'radioGroup') this.group = true;
|
if (this.$parent && this.$parent.$options.name === 'RadioGroup') this.group = true;
|
||||||
if (!this.group) {
|
if (!this.group) {
|
||||||
this.updateValue();
|
this.updateValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
// },
|
// },
|
||||||
currentValue: {
|
currentValue: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler (val) {
|
handler () {
|
||||||
this.setHalf(this.currentValue);
|
this.setHalf(this.currentValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
:value="item.checked && item.childrenCheckedStatus == 2"
|
:value="item.checked && item.childrenCheckedStatus == 2"
|
||||||
:disabled="item.disabled || item.disableCheckbox"
|
:disabled="item.disabled || item.disableCheckbox"
|
||||||
:indeterminate="item.checked && item.childrenCheckedStatus == 1"
|
:indeterminate="item.checked && item.childrenCheckedStatus == 1"
|
||||||
@click.prevent="setCheck(item.disabled||item.disableCheckbox, index)"></Checkbox>
|
@click.native.prevent="setCheck(item.disabled||item.disableCheckbox, index)"></Checkbox>
|
||||||
<a :class="titleCls(item)" @click="setSelect(item.disabled, index)">
|
<a :class="titleCls(item)" @click="setSelect(item.disabled, index)">
|
||||||
<span :class="[prefixCls + '-title']" v-html="item.title"></span>
|
<span :class="[prefixCls + '-title']" v-html="item.title"></span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -181,7 +181,7 @@
|
||||||
this.dispatch('Tree', 'nodeSelected', {
|
this.dispatch('Tree', 'nodeSelected', {
|
||||||
ori: this,
|
ori: this,
|
||||||
selected: selected
|
selected: selected
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setCheck (disabled, index) {
|
setCheck (disabled, index) {
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
transition: all @transition-time @ease-in-out;
|
transition: all @transition-time @ease-in-out;
|
||||||
}
|
}
|
||||||
&.@{tree-prefix-cls}-switcher-noop {
|
&.@{tree-prefix-cls}-switcher-noop {
|
||||||
display: none;
|
//display: none;
|
||||||
cursor: auto;
|
cursor: auto;
|
||||||
i{
|
i{
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
@ -1,21 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<Tree v-model="baseData" show-checkbox></Tree>
|
||||||
<Tree
|
|
||||||
v-model="treeData"
|
|
||||||
:show-checkbox="true"
|
|
||||||
:multiple="true"
|
|
||||||
@on-select-change="selectFn"
|
|
||||||
@on-check-change="checkFn"></Tree>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data: function() {
|
data () {
|
||||||
return {
|
return {
|
||||||
treeData: [{
|
baseData: [{
|
||||||
expand: true,
|
expand: true,
|
||||||
title: 'parent 1',
|
title: 'parent 1',
|
||||||
selected: false,
|
|
||||||
children: [{
|
children: [{
|
||||||
title: 'parent 1-0',
|
title: 'parent 1-0',
|
||||||
expand: true,
|
expand: true,
|
||||||
|
@ -28,21 +20,14 @@
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
title: 'parent 1-1',
|
title: 'parent 1-1',
|
||||||
|
expand: true,
|
||||||
checked: true,
|
checked: true,
|
||||||
children: [{
|
children: [{
|
||||||
title: '<span style="color: red">sss</span>',
|
title: '<span style="color: red">leaf</span>'
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
selectFn(data){
|
|
||||||
console.log(data);
|
|
||||||
},
|
|
||||||
checkFn(data){
|
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue