uni-app运行到小程序遇到的问题

1、v-for循环嵌套的时候 index不能使用相同的名称

//错误写法
<view v-for='(item,index) in arr1'>
    <view v-for='(group,index) in arr2'></view>
<view>
//正确写法
<view v-for='(item,index) in arr1'>
    <view v-for='(group,i) in arr2'></view>
</view>

2、插槽语法

//小程序中使用作用域插槽时必须使用结构的语法
//错误写法
<template v-slot:right='datas'>
        <view>{{datas.data}}</view>
</template>
//正确写法
<template v-slot:right="{data}">
    <view>{{data}}</view>
</template>

当然:v-slot可以使用简写的方式

 

如果再发现其他的问题,后续会继续追加

posted @ 2023-01-29 15:29  苑超  阅读(219)  评论(0编辑  收藏  举报