[improvement] TreeSelect: support disable option (#2107)

This commit is contained in:
neverland
2018-11-19 20:33:14 +08:00
committed by GitHub
parent 60096804a5
commit bf9db97921
7 changed files with 55 additions and 38 deletions
+7 -2
View File
@@ -18,7 +18,10 @@
v-for="item in subItems"
:key="item.id"
class="van-ellipsis"
:class="b('item', { active: activeId === item.id })"
:class="b('item', {
active: activeId === item.id,
disabled: item.disabled
})"
@click="onItemSelect(item)"
>
{{ item.text }}
@@ -66,7 +69,9 @@ export default create({
methods: {
onItemSelect(data) {
this.$emit('itemclick', data);
if (!data.disabled) {
this.$emit('itemclick', data);
}
}
}
});