uni-app icon indicating copy to clipboard operation
uni-app copied to clipboard

支付宝原生组件变量会被编译

Open 1365436742 opened this issue 2 years ago • 2 comments

问题描述

  1. 支付宝自定义原生组件,变量名会被编译,无法传入props
  2. 支付宝自定义原生组件,传入props为方法的时候,虽然可以编译成on开头的方法但是也无法执行次方法,会有报错CallMethod error Cannot read properties of undefined (reading 'type')。TypeError: Cannot read properties of undefined (reading 'type')

复现步骤 [复现问题的步骤]

  1. src下创建mycomponents,并传入变量props和方法props,在写一个按钮,点击执行此方法
  2. 在pages中引用mycomponents中创建的组件,传入props

[或者可以直接贴源代码] 支付宝原生组件 src/mycomponents/test/index.axml <button size="default" type="primary" onTap="onTabA">Button</button>

src/mycomponents/test/index.js Component({ props: { visible: "", onAdClose: () => { }, }, methods: { onTabA() { this.props.onAdClose() } }, });

vue使用 `src/pages/test/index.vue

`

预期结果 在原生组件props不被编译

实际结果 image

系统信息:

  • uni-app版本 3.0.0-3090820231124001
  • vite 4.0.3
  • vue 3.2.45

1365436742 avatar Dec 20 '23 02:12 1365436742

#4376

yurj26 avatar Dec 25 '23 11:12 yurj26

如果问题未解决,或者还有其他问题,请选择 reopen,this issues will be close

Otto-J avatar Jan 04 '24 06:01 Otto-J