index.js 490B

12345678910111213141516171819202122
  1. import { VantComponent } from '../common/component';
  2. VantComponent({
  3. relation: {
  4. type: 'ancestor',
  5. name: 'badge-group'
  6. },
  7. props: {
  8. info: null,
  9. title: String
  10. },
  11. methods: {
  12. onClick() {
  13. const group = this.getRelationNodes('../badge-group/index')[0];
  14. if (group) {
  15. group.setActive(this);
  16. }
  17. },
  18. setActive(active) {
  19. this.set({ active });
  20. }
  21. }
  22. });