AlwaysLoveme / vant-ttapp

参照Vant-Weapp开发的抖音原生小程序UI组件库
MIT License
7 stars 3 forks source link

getRelationNodes 应该是异步的 #10

Open s2mh opened 1 year ago

s2mh commented 1 year ago

https://github.com/AlwaysLoveme/vant-ttapp/blob/dc7febf6a523755a74efee4e4fbfa3535d1788e4/lib/common/relation.js#L26

参考官方文档里的代码

_getAllLi() {
      // 使用getRelationNodes可以获得nodes数组,包含所有已关联的custom-li,且是有序的
      this.getRelationNodes("path/to/custom-li", (nodes) => {
        // do something
      });
    },

建议试试 dropdown-menu 应该有问题

zk320520 commented 11 months ago

这个问题还好,可以通过 promise + async/await 解决,要命的是抖音小程序组件不支持 externalClasses 外部样式类