Skip to content

Taro能使用wxs吗? #2959

@Rychou

Description

@Rychou

问题描述
最近使用movable-view做了一个拖拽排序的功能,但是由于需要touchmove事件频繁setState来更新movable-view的坐标,导致Android的上的性能体验很差,IOS不会。

看了微信的文档,这种情况可以使用WXS来解决,请问Taro中能否使用WXS?如何使用呢?

参考文档: https://developers.weixin.qq.com/miniprogram/dev/framework/view/interactive-animation.html
https://developers.weixin.qq.com/miniprogram/dev/framework/performance/tips.html

Activity

taro-bot

taro-bot commented on May 6, 2019

@taro-bot

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

luckyadam

luckyadam commented on May 6, 2019

@luckyadam
Member

频繁 setState 来更新可以通过加节流来尝试解决

Rychou

Rychou commented on May 6, 2019

@Rychou
Author

频繁 setState 来更新可以通过加节流来尝试解决

movable-view这种需要即时更新坐标信息的也能节流吗?

Miantang

Miantang commented on May 6, 2019

@Miantang

试过节流,这样动画掉帧十分厉害

Rychou

Rychou commented on May 6, 2019

@Rychou
Author

试过节流,这样动画掉帧十分厉害

目前打算在Taro编译之后,自己在小程序开发者工具中写wxs代码

taro-bot

taro-bot commented on May 6, 2019

@taro-bot

Hello~

您的问题楼上已经提供了解决方案,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

Miantang

Miantang commented on May 7, 2019

@Miantang

试过节流,这样动画掉帧十分厉害

目前打算在Taro编译之后,自己在小程序开发者工具中写wxs代码

这样就很恶心了,每次编译都要重新修改dist文件。

Miantang

Miantang commented on May 7, 2019

@Miantang

频繁 setState 来更新可以通过加节流来尝试解决

没有计划支持wxs的么?对于一些性能要求高的交互场景,只能通过wxs避免 逻辑线程和视图线程的频繁通信损耗

Rychou

Rychou commented on May 7, 2019

@Rychou
Author

试过节流,这样动画掉帧十分厉害

目前打算在Taro编译之后,自己在小程序开发者工具中写wxs代码

这样就很恶心了,每次编译都要重新修改dist文件。

那倒不用,在dist下面添加个.wxs的文件,重新编译文件还在的。
我昨天用wxs优化了,晚点写个文章总结一下好了。不过最好还是Taro自己支持wxs

Miantang

Miantang commented on May 7, 2019

@Miantang

试过节流,这样动画掉帧十分厉害

目前打算在Taro编译之后,自己在小程序开发者工具中写wxs代码

这样就很恶心了,每次编译都要重新修改dist文件。

那倒不用,在dist下面添加个.wxs的文件,重新编译文件还在的。
我昨天用wxs优化了,晚点写个文章总结一下好了。不过最好还是Taro自己支持wxs

wxs是在,但是你是还是需要去修改引用它的wxml吧?难道把wxs组件写在taro的jsx中吗

Rychou

Rychou commented on May 7, 2019

@Rychou
Author

试过节流,这样动画掉帧十分厉害

目前打算在Taro编译之后,自己在小程序开发者工具中写wxs代码

这样就很恶心了,每次编译都要重新修改dist文件。

那倒不用,在dist下面添加个.wxs的文件,重新编译文件还在的。
我昨天用wxs优化了,晚点写个文章总结一下好了。不过最好还是Taro自己支持wxs

wxs是在,但是你是还是需要去修改引用它的wxml吧?难道把wxs组件写在taro的jsx中吗

@luckyadam
试过了,可以不修改wxml。晚点总结了后发文章到时候给你链接吧。不过这里还是希望Taro能支持wxs

Rychou

Rychou commented on May 8, 2019

@Rychou
Author

@Miantang 小程序Android端movable-view拖拽卡顿掉帧的优化可以参考一下,不过最好还是Taro能够支持WXS的编程。

luckyadam

luckyadam commented on May 8, 2019

@luckyadam
Member

@Rychou 这个优化很棒啊,我们看一下如何支持一下

不过,这里是不是也可以不用 wxs,直接把这个方法写到类里不行么

28 remaining items

nelk98

nelk98 commented on Apr 13, 2022

@nelk98

2022了还有望支持吗?

zhoulujun

zhoulujun commented on Oct 27, 2022

@zhoulujun

2023了还有望支持吗?

oplknm11

oplknm11 commented on Dec 14, 2022

@oplknm11

2023了还有望支持吗?

harwinvoid

harwinvoid commented on Dec 16, 2022

@harwinvoid

2023了还有望支持吗?

youmengme

youmengme commented on Mar 21, 2023

@youmengme

2023了还有望支持吗?

nelk98

nelk98 commented on Mar 21, 2023

@nelk98

2023了还有望支持吗?

daniel-duan

daniel-duan commented on Mar 23, 2023

@daniel-duan

2023了还有望支持吗?

yanchengqu

yanchengqu commented on Apr 14, 2023

@yanchengqu

2023年4月14日了,还不支持吗?或者有更好方案也行

SuJunming

SuJunming commented on Jun 26, 2023

@SuJunming
Contributor

2023年6月26日了,还不支持吗?或者有更好方案也行.

qsj919

qsj919 commented on Jun 27, 2023

@qsj919

Taro3这样使用似乎行不通?报错Template `tmpl_2_wxs` not found.

有解决吗

可以用小程序原生组件来搞定,就是显得特别扭

是的,我目前就是这么干的,就是多写了一堆代码

请问具体应该怎么写呢

youmengme

youmengme commented on Dec 8, 2023

@youmengme

2023年12月08日了,还不支持吗?或者有更好方案也行.

youmengme

youmengme commented on Feb 2, 2024

@youmengme

2024了还有望支持吗?

Chen-jj

Chen-jj commented on Apr 2, 2024

@Chen-jj
Contributor
imtns

imtns commented on Aug 29, 2024

@imtns

vue 不打算支持了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @nyrf@luckyadam@Miantang@zhoulujun@yuche

      Issue actions

        Taro能使用wxs吗? · Issue #2959 · NervJS/taro