新手村的NPC
新手村的NPC
  • 发布:2025-07-15 10:41
  • 更新:2025-07-15 10:52
  • 阅读:54

uniapp 鸿蒙插件的方法怎么调用

分类:uts

请教下:
官方提供了一个原生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()  
        }  
      })  
  }  
}
2025-07-15 10:41 负责人:无 分享
已邀请:
DCloud_UNI_yuhe
  • 新手村的NPC (作者)

    已经解决 DCloud_UNI_OttoJi大佬告诉我了,怎么再外部直接调用鸿蒙的自定义方法testLog

    2025-07-15 14:50

要回复问题请先登录注册