index.js 472 B

12345678910111213141516171819202122232425
  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: function onClick() {
  13. var group = this.getRelationNodes('../badge-group/index')[0];
  14. if (group) {
  15. group.setActive(this);
  16. }
  17. },
  18. setActive: function setActive(active) {
  19. this.set({
  20. active: active
  21. });
  22. }
  23. }
  24. });