uView2.0 icon indicating copy to clipboard operation
uView2.0 copied to clipboard

u-picker组件语法错误

Open Niangao-Warren opened this issue 2 years ago • 2 comments

版本

2.0.33

转载链接

github.com

重现步骤

<text
v-if="$u.test.array(item)"
class="u-picker__view__column__item u-line-1"
v-for="(item1, index1) in item"
:key="index1"
:style="{
	height: $u.addUnit(itemHeight),
	lineHeight: $u.addUnit(itemHeight),
	fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal',
}"
>{{ getItemText(item1) }}</text
>

期望的结果是什么?

不报错

实际的结果是什么?

报错


v-if不能和v-for一起使用

Niangao-Warren avatar Jul 26 '22 07:07 Niangao-Warren

https://staging-cn.vuejs.org/guide/essentials/conditional.html#v-if-vs-v-show

ChenLiuPng avatar Jul 26 '22 17:07 ChenLiuPng

v-if和v-for有优先级问题,你if用一层template就好了

Qiu-Jun avatar Jul 30 '22 18:07 Qiu-Jun