先放代码
type ITest={
aa?:string,
bb?:string
}
type IProps = {
styles ?: ITest
}
const props = withDefaults(defineProps<IProps>(), {
styles:():ITest=>({}),
})
出现报错
Cannot create property 'code' on string 'load_transformed failed
19:45:14.249 Caused by:
19:45:14.249 0: Bundler.load() failed
19:45:14.249 1: Bundler.loader.load(D:\Code\jui\jui\unpackage\dist\dev.uvue\uni_modules\j-ui\components\j-navbar\j-navbar.uvue) failed
19:45:14.249 2:
19:45:14.249 x Expected ',', got '?'
19:45:14.249 at uni_modules/j-ui/components/j-navbar/j-navbar.uvue:17:1
19:45:14.249 14 | export default {
19:45:14.249 15 | name: 'j-navbar',
19:45:14.250 16 | props: {
19:45:14.250 17 | styles: { type: [Object as PropType<aa?:string,>, Object as PropType<bb?:string>], required: false, default: ():ITest=>({}) }
19:45:14.250 : ^
19:45:14.250 18 | },
19:45:14.250 19 | emits: ["ratioChange"],
19:45:14.250 20 | setup(props: GenUniModulesJUiComponentsJNavbarJNavbar) {
19:45:14.250 `----
19:45:14.250
19:45:14.250 3: Syntax Error'
环境:win11 hbuilder:4.24 安卓模拟器运行 标准基座
请问这种情况如何解决?
1***@qq.com
兄弟可以贴下 map代码吗 要怎么写
2024-08-16 08:52