index.js 512 B

123456789101112131415161718192021222324252627282930
  1. import { VantComponent } from '../common/component';
  2. VantComponent({
  3. relation: {
  4. name: 'tabs',
  5. type: 'ancestor'
  6. },
  7. props: {
  8. title: String,
  9. disabled: Boolean
  10. },
  11. data: {
  12. inited: false,
  13. active: false,
  14. animated: false,
  15. width: null
  16. },
  17. watch: {
  18. title: 'update',
  19. disabled: 'update'
  20. },
  21. methods: {
  22. update: function update() {
  23. var parent = this.getRelationNodes('../tabs/index')[0];
  24. if (parent) {
  25. parent.updateTabs();
  26. }
  27. }
  28. }
  29. });