123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- Component({
-
- properties: {
-
- tabItemJson: {
- type: Array,
- value: []
- },
-
- initTabIndex: {
- type: Number,
- value: 0
- }
- },
-
- data: {
- currentTab: 0,
- },
- lifetimes: {
- attached: function () {
-
- this.initTab(this.properties.initTabIndex)
- },
- detached: function () {
-
- },
- },
-
- methods: {
-
- bindTabItem: function (event: any) {
- this.initTab(Number(event.target.id))
- },
- initTab: function (index: any) {
- this.setData({
- currentTab: index
- })
- this.triggerEvent('selectItemIndex', { selectIndex: index });
- }
- }
- })
|