// blist.uts
export default [
{
title: '第一集',
desc: '描述'
}
]
<template>
<text v-for="(item,index) in dataSource" :key="index">{{item}}</text>
</template>
<script setup>
type TypeList = {
title: string,
desc: string
};
import list from '@/common/blist.uts';
console.log(list)
const dataSource = ref(list);
</script>
控制台报错
13:47:54.059 [plugin:uni:app-uts] 编译失败
13:47:54.059 error: 'public' property exposes its 'local' type argument <no name provided>
我需要怎么写才能编译过去?
1 个回复
DCloud_heavensoft
list是啥类型,ustjsonobject?你得仔细看UTSJSONObject和type的文档