mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
30 lines
559 B
JavaScript
30 lines
559 B
JavaScript
'use strict';
|
|
|
|
var _relations;
|
|
|
|
var BADGE_GROUP_PATH = '../badge-group/index';
|
|
|
|
Component({
|
|
externalClasses: ['custom-class'],
|
|
|
|
relations: (_relations = {}, _relations[BADGE_GROUP_PATH] = {
|
|
type: 'ancestor'
|
|
}, _relations),
|
|
|
|
properties: {
|
|
info: Number,
|
|
title: String
|
|
},
|
|
|
|
methods: {
|
|
onTap: function onTap() {
|
|
var group = this.getRelationNodes(BADGE_GROUP_PATH)[0];
|
|
if (group) {
|
|
group.setActive(this);
|
|
}
|
|
},
|
|
setActive: function setActive(active) {
|
|
this.setData({ active: active });
|
|
}
|
|
}
|
|
}); |