Blame view

src/components/tabs/pane.vue 1.4 KB
871ed4d8   梁灏   init Tabs component
1
  <template>
77bafb31   梁灏   update Tabs
2
      <div :class="prefixCls" v-show="show"><slot></slot></div>
871ed4d8   梁灏   init Tabs component
3
4
  </template>
  <script>
17f52abf   梁灏   update Tabs
5
6
      const prefixCls = 'ivu-tabs-tabpane';
  
871ed4d8   梁灏   init Tabs component
7
      export default {
17f52abf   梁灏   update Tabs
8
9
          name: 'TabPane',
          props: {
30510c3d   梁灏   support Tabs
10
              name: {
17f52abf   梁灏   update Tabs
11
12
13
                  type: String
              },
              label: {
bef89707   Aresn   update tabs
14
                  type: [String, Function],
17f52abf   梁灏   update Tabs
15
16
17
18
19
20
21
22
                  default: ''
              },
              icon: {
                  type: String
              },
              disabled: {
                  type: Boolean,
                  default: false
7a737482   梁灏   fixed #206
23
24
25
26
              },
              closable: {
                  type: Boolean,
                  default: null
17f52abf   梁灏   update Tabs
27
28
              }
          },
871ed4d8   梁灏   init Tabs component
29
          data () {
17f52abf   梁灏   update Tabs
30
31
              return {
                  prefixCls: prefixCls,
30510c3d   梁灏   support Tabs
32
33
                  show: true,
                  currentName: this.name
b0893113   jingsam   :art: add eslint
34
              };
17f52abf   梁灏   update Tabs
35
          },
17f52abf   梁灏   update Tabs
36
37
38
39
          methods: {
              updateNav () {
                  this.$parent.updateNav();
              }
871ed4d8   梁灏   init Tabs component
40
          },
17f52abf   梁灏   update Tabs
41
          watch: {
30510c3d   梁灏   support Tabs
42
43
44
45
              name (val) {
                  this.currentName = val;
                  this.updateNav();
              },
17f52abf   梁灏   update Tabs
46
47
48
49
50
51
52
53
54
              label () {
                  this.updateNav();
              },
              icon () {
                  this.updateNav();
              },
              disabled () {
                  this.updateNav();
              }
420ef343   梁灏   fixed #155
55
          },
30510c3d   梁灏   support Tabs
56
          mounted () {
420ef343   梁灏   fixed #155
57
              this.updateNav();
c2d74eca   梁灏   fixed #2100
58
59
60
          },
          destroyed () {
              this.updateNav();
17f52abf   梁灏   update Tabs
61
          }
b0893113   jingsam   :art: add eslint
62
63
      };
  </script>