n***@qq.com
n***@qq.com
  • 发布:2025-09-17 09:06
  • 更新:2025-09-17 09:06
  • 阅读:21

uniapp x中defineProps能用自定义类型吗

分类:uni-app x
<script setup>  
import { Msg } from '@/model/chat.uts'  

interface Props {  
  msg : Msg,  
  msgId : String  
}  
const props = defineProps<Props>()

这样h5能运行起来,但安卓报错

:05:15.483          x Expression expected  
09:05:15.483            at components/message-list/message-bubble.uvue:10:1  
09:05:15.483          7 |     __name: 'message-bubble',  
09:05:15.483          8 |     __props: Props,  
09:05:15.483          9 |     props: {  
09:05:15.483         10 |         msg: { type: [Object as PropType<id>, String,  > , Object as PropType<avatar>, String,  > , Object as PropType<atUserList>, Array<String>,  > , Object as PropType<conversationID>, String,  > , Object as PropType<conversationType>, String,  > , Object as PropType<flow>, String,  > , Object as PropType<from>, String,  > , Object as PropType<nick>, String,  > , Object as PropType<to>, String > , Object as PropType<type>, String > , Object as PropType<time>, Number > , Object as PropType<text>, MsgText > ], required: true },
2025-09-17 09:06 负责人:无 分享
已邀请:

要回复问题请先登录注册