mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
智慧宿舍系统小程序
This commit is contained in:
29
wechat/miniprogram/node_modules/@vant/weapp/dist/sidebar-item/index.js
generated
vendored
Normal file
29
wechat/miniprogram/node_modules/@vant/weapp/dist/sidebar-item/index.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
import { useParent } from '../common/relation';
|
||||
VantComponent({
|
||||
classes: ['active-class', 'disabled-class'],
|
||||
relation: useParent('sidebar'),
|
||||
props: {
|
||||
dot: Boolean,
|
||||
badge: null,
|
||||
info: null,
|
||||
title: String,
|
||||
disabled: Boolean,
|
||||
},
|
||||
methods: {
|
||||
onClick() {
|
||||
const { parent } = this;
|
||||
if (!parent || this.data.disabled) {
|
||||
return;
|
||||
}
|
||||
const index = parent.children.indexOf(this);
|
||||
parent.setActive(index).then(() => {
|
||||
this.$emit('click', index);
|
||||
parent.$emit('change', index);
|
||||
});
|
||||
},
|
||||
setActive(selected) {
|
||||
return this.setData({ selected });
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user