fix: 修复 Vue 模板 data-* 属性绑定语法错误
- 将 data-nutrient-index/data-item-id/data-item-kid 的 {{ }} 插值语法
改为 v-bind (:) 简写语法
- 适配 Vue 2 模板编译规范
Error: Interpolation inside attributes has been removed.
Use v-bind or the colon shorthand instead.
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
class="nutrient-card"
|
class="nutrient-card"
|
||||||
v-for="(item, index) in nutrientList"
|
v-for="(item, index) in nutrientList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="goToNutrientDetail" data-nutrient-index="{{ index }}"
|
@click="goToNutrientDetail" :data-nutrient-index="index"
|
||||||
>
|
>
|
||||||
<view class="nutrient-icon-wrapper">
|
<view class="nutrient-icon-wrapper">
|
||||||
<text class="nutrient-icon">{{ item.icon }}</text>
|
<text class="nutrient-icon">{{ item.icon }}</text>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
class="knowledge-item"
|
class="knowledge-item"
|
||||||
v-for="(item, index) in (guideList || [])"
|
v-for="(item, index) in (guideList || [])"
|
||||||
:key="item.knowledgeId || item.id || index"
|
:key="item.knowledgeId || item.id || index"
|
||||||
@click="goToDetail" data-item-id="{{ item.id }}" data-item-kid="{{ item.knowledgeId }}"
|
@click="goToDetail" :data-item-id="item.id" :data-item-kid="item.knowledgeId"
|
||||||
>
|
>
|
||||||
<view class="knowledge-cover" v-if="item.coverImage || item.cover_image">
|
<view class="knowledge-cover" v-if="item.coverImage || item.cover_image">
|
||||||
<image :src="item.coverImage || item.cover_image" mode="aspectFill" class="cover-img" />
|
<image :src="item.coverImage || item.cover_image" mode="aspectFill" class="cover-img" />
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
class="knowledge-item"
|
class="knowledge-item"
|
||||||
v-for="(item, index) in (articleList || [])"
|
v-for="(item, index) in (articleList || [])"
|
||||||
:key="item.knowledgeId || item.id || index"
|
:key="item.knowledgeId || item.id || index"
|
||||||
@click="goToDetail" data-item-id="{{ item.id }}" data-item-kid="{{ item.knowledgeId }}"
|
@click="goToDetail" :data-item-id="item.id" :data-item-kid="item.knowledgeId"
|
||||||
>
|
>
|
||||||
<view class="knowledge-cover" v-if="item.coverImage || item.cover_image">
|
<view class="knowledge-cover" v-if="item.coverImage || item.cover_image">
|
||||||
<image :src="item.coverImage || item.cover_image" mode="aspectFill" class="cover-img" />
|
<image :src="item.coverImage || item.cover_image" mode="aspectFill" class="cover-img" />
|
||||||
|
|||||||
Reference in New Issue
Block a user