2018-08-22 10:32:27 +08:00

36 lines
509 B
JavaScript

const TABBAR_PATH = '../tabbar/index';
Component({
properties: {
info: null,
icon: String,
dot: Boolean
},
options: {
multipleSlots: true,
addGlobalClass: true
},
relations: {
[TABBAR_PATH]: {
type: 'ancestor'
}
},
data: {
active: false,
count: 0
},
methods: {
onClick() {
const parent = this.getRelationNodes(TABBAR_PATH)[0];
if (parent) {
parent.onChange(this);
}
this.triggerEvent('click');
}
}
});