1234567891011121314151617181920212223242526272829303132333435 |
- const app = getApp();
- Component({
- props: {
- componentData: {}
- },
- data: {
- imgSrcPrefix: app.globalData.imgSrcPrefix,
- tabs: [],
- activeTab: 0
- },
- didMount() {
- const {
- componentExtInfo = {}
- } = this.props.componentData;
- this.setData({
- tabs: JSON.parse(componentExtInfo.inpatientIndexTab || '[]').map(item => ({
- title: item.tabName,
- ...item
- }))
- });
- },
- methods: {
- handleTabClick({
- index,
- tabsName
- }) {
- this.setData({
- [tabsName]: index
- });
- }
- }
- });
|