l***@moyuan.cc
l***@moyuan.cc
  • 发布:2025-09-03 18:55
  • 更新:2025-09-04 10:43
  • 阅读:43

如何使用UTS实现一个lottie组件

分类:鸿蒙Next

我这边的资源文件目前是再static目录下面 再UTS文件里写了一个获取获取资源文件路径的方法

vue页面导入调用也获取到了/data/storage/el2/base/files/apps/HBuilder/www/static/logo.png 这样的文件路径然后传入给ets文件使用没有任何效果

2025-09-03 18:55 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

hello , 你 ets 文件使用,是在哪里使用?

  • l***@moyuan.cc (作者)

    再vue文件里面使用

    2025-09-05 15:07

  • l***@moyuan.cc (作者)

    <embed class="native-button" tag="button" :options="options" @buttonclick="onClick"></embed>  
    data() {
    return {
    title: 'Hello',
    options: {
    label: 'Hello',
    url: ''
    }
    }
    },
    async onLoad() {
    const res = await getPublicResource('/static/logo.png')
    console.log(res.path);
    this.options = {
    label: res.path,
    url: res.path
    }
    // setTimeout(() => {
    // console.log('更新数据');
    // this.options = {
    // label: `world`
    // }
    // }, 2000)
    },

    2025-09-05 15:08

要回复问题请先登录注册