heroMan
heroMan
  • 发布:2025-11-29 12:03
  • 更新:2025-11-29 12:03
  • 阅读:24

uniapp-x是真垃圾啊

分类:uni-app x

不得不说uniapp-x是TM真垃圾啊,天坑。
代码 :

uts:  
export type AppointModel = {  
  appointId: number,  
    storeId: number,  
    // 门店icon  
    storeIcon?: string | null,  
    // 门店名  
    storeName: string | null,  
    // 门店地址  
    address?: string | null,  
    doctorId: number,  
    doctorName: string,  
    photo?: string | null,  

    date?: number | null,  
    start?: number | null,  
    end?: number | null,  
    status: AppointStatus  
}  
uvue:   
<template>  
    <z-paging-x class="list-class" ref="pagingX" v-model="appointsList" @query="queryList">  

        <list-item v-for="(item, index) in appointsList" :key="index">  
            <AppointListCell :appointModel="item"></AppointListCell>  
        </list-item>  
    </z-paging-x>  
</template>

编译报错:

11:59:25.256 [plugin:uni:app-uts] Unexpected token `...`. Expected an identifier, void, yield, null, await, break, a string literal, a numeric literal, true, false, `, -, import, this, typeof, {, [, (  
11:59:25.256 at unpackage/dist/dev/.uvue/app-android/pages/appointment/appointlist/appointlist.uvue:75:243  
11:59:25.256      74 |                 modelValue: unref(appointsList),  
11:59:25.256   >  75 |                 "onUpdate:modelValue": ($event: { appointId: number; storeId: number; storeIcon?: string | null | undefined; storeName: string | null; address?: string | null | undefined; doctorId: number; doctorName: string; photo?: string | ... 1 more ... | undefined; date?: number | ... 1 more ... | undefined; start?: number | ... 1 more ... | undefined; end?: number | ... 1 more ... | undefined; status: AppointStatus; }[]) => { trySetRefValue(appointsList, $event); },  
11:59:25.256                                                                                                                                                                                                                                                             ^  
11:59:25.256      76 |                 onQuery: queryList

然后去看HBuilder编译的中间产物

"onUpdate:modelValue": ($event: { appointId: number; storeId: number; storeIcon?: string | null | undefined; storeName: string | null; address?: string | null | undefined; doctorId: number; doctorName: string; photo?: string | ... 1 more ... | undefined; date?: number | ... 1 more ... | undefined; start?: number | ... 1 more ... | undefined; end?: number | ... 1 more ... | undefined; status: AppointStatus; }[]) => { trySetRefValue(appointsList, $event); },

编译的这是什么jb玩意儿,type多定义了几个字段,这垃圾就编译不了了,出来一堆什么鬼 ... 1 more ...
煞笔 垃圾

2025-11-29 12:03 负责人:无 分享
已邀请:

要回复问题请先登录注册