用uniapp+vue2+typescript 写一个列表代码,每个item包含姓名,年龄,性别参数
时间: 2023-03-13 21:20:40 浏览: 82
uniapp + vue3 + TypeScript + pinia + uviewplus
<template>
<view>
<block>
<view v-for="(item, index) in list" :key="index">
姓名:{{item.name}},年龄:{{item.age}},性别:{{item.gender}}
</view>
</block>
</view>
</template><script>
export default {
data() {
return {
list: [
{name: '张三', age: 18, gender: '男'},
{name: '李四', age: 20, gender: '女'},
{name: '王五', age: 25, gender: '男'},
],
}
}
}
</script>
阅读全文