请教下:
官方提供了一个原生button,可以在uniapp的vue页面中直接通过<embed>标签显示
<embed class="native-button" tag="button" ref="button"></embed>
问下,vue页面里面怎么调用到这个testLog方法,怎么一个文档都没有找到
@Component
struct ButtonComponent {
@Prop label: string
onButtonClick?: Function
testLog():void{
console.log("testLog")
}
build() {
Button(this.label)
.width('100%')
.height('100%')
.onClick(() => {
if (this.onButtonClick) {
this.onButtonClick()
}
})
}
}
新手村的NPC (作者)
已经解决 DCloud_UNI_OttoJi大佬告诉我了,怎么再外部直接调用鸿蒙的自定义方法testLog
2025-07-15 14:50