fix: 修复v-for和v-if在同一元素导致内容不渲染的问题
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -70,7 +70,7 @@
|
|||||||
<input class="input attr-unit" v-model="attr.unit" placeholder="单位" />
|
<input class="input attr-unit" v-model="attr.unit" placeholder="单位" />
|
||||||
<text class="attr-delete" @click="removeAttr(index)">×</text>
|
<text class="attr-delete" @click="removeAttr(index)">×</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(attr, index) in attributes" :key="'formula-'+index" class="formula-item" v-if="attr.attrType === 'formula'">
|
<view v-for="(attr, index) in formulaAttrs" :key="'formula-'+index" class="formula-item">
|
||||||
<text class="formula-label">公式:</text>
|
<text class="formula-label">公式:</text>
|
||||||
<input class="input formula-input" v-model="attr.formula" placeholder="例如: length * width" />
|
<input class="input formula-input" v-model="attr.formula" placeholder="例如: length * width" />
|
||||||
</view>
|
</view>
|
||||||
@@ -107,6 +107,11 @@ export default {
|
|||||||
attributes: []
|
attributes: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
formulaAttrs() {
|
||||||
|
return this.attributes.filter(a => a.attrType === 'formula')
|
||||||
|
}
|
||||||
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.loadCategories()
|
this.loadCategories()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user