小笔记:vue3中v-for循环ts报错,item中不存在XXX属性

再学习vue3时,发现item报错,上百度后发现一方法得以解决

粘在此处做个日志

type item = {

    id: string;

    title: string;

    description: string;

};

const props = defineProps({

    testMsg: {

        type: Array as unknown as PropType,

        default: () => [{ id: "there is id", title: "there is title", description: "there is description" }],

    },

});

你可能感兴趣的:(笔记,vue.js,javascript)