mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
[new feature] TreeSelect: update style、support disable nav item (#2308)
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
<div
|
||||
v-for="(item, index) in items"
|
||||
class="van-ellipsis"
|
||||
:class="b('nitem', { active: mainActiveIndex === index })"
|
||||
@click="$emit('navclick', index)"
|
||||
:class="b('nitem', { active: mainActiveIndex === index, disabled: item.disabled })"
|
||||
@click="onClickNav(item, index)"
|
||||
>
|
||||
{{ item.text }}
|
||||
</div>
|
||||
@@ -27,7 +27,8 @@
|
||||
{{ item.text }}
|
||||
<icon
|
||||
v-if="activeId === item.id"
|
||||
name="success"
|
||||
name="checked"
|
||||
size="16px"
|
||||
:class="b('selected')"
|
||||
/>
|
||||
</div>
|
||||
@@ -62,6 +63,12 @@ export default create({
|
||||
},
|
||||
|
||||
methods: {
|
||||
onClickNav(data, index) {
|
||||
if (!data.disabled) {
|
||||
this.$emit('navclick', index);
|
||||
}
|
||||
},
|
||||
|
||||
onItemSelect(data) {
|
||||
if (!data.disabled) {
|
||||
this.$emit('itemclick', data);
|
||||
|
Reference in New Issue
Block a user