Fix:view视图中使用赋值语句导致运行报错
This commit is contained in:
@@ -14,6 +14,9 @@ export default {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
changeType(index){
|
||||
this.typeIndex=index
|
||||
},
|
||||
init() {
|
||||
seasonHomeData().then(({data}) => this.list = data.seasonalFoodType || []);
|
||||
},
|
||||
@@ -31,7 +34,7 @@ export default {
|
||||
<template v-if="typeList.length">
|
||||
<view class="type-box">
|
||||
<u-grid col="4">
|
||||
<u-grid-item v-for="(item,index) in list" :key="index" @click="typeIndex=index">
|
||||
<u-grid-item v-for="(item,index) in list" :key="index" @click="changeType(index)">
|
||||
<image class="icon-logo" :class="{'choose-icon':typeIndex===index}" :src="item.logo" mode="scaleToFill"/>
|
||||
<text class="type-name" :class="{'choose-name':typeIndex===index}">{{ item.name }}</text>
|
||||
</u-grid-item>
|
||||
|
||||
Reference in New Issue
Block a user