"use strict"; Component({ ready: function () { if (!this.data.tabList.length) return; var id = this.data.tabList[0].id; this.setData({ tab: id }); this.triggerEvent('change', id); }, properties: { list: { type: Array, value: [] } }, data: { tab: 0, tabList: [ { title: "剪辑", number: 0, id: 0 }, ] }, methods: { clickTab: function () { var _this = this; var tabData = arguments[0].currentTarget.dataset; this.setData({ tab: tabData.id }, function () { return _this.triggerEvent("Change", tabData.id); }); } } });