Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

转换后, 事件名未删除on前缀 #2186

Closed
binlaniua opened this issue Feb 16, 2019 · 6 comments
Closed

转换后, 事件名未删除on前缀 #2186

binlaniua opened this issue Feb 16, 2019 · 6 comments
Assignees

Comments

@binlaniua
Copy link

binlaniua commented Feb 16, 2019

Feature Request 请提到 FeatHub

如果是提交 bug,请搜索文档和 issue,确认以下事项:

  • 该问题没有在其他 issue 和文档讨论到,不属于重复内容

  • 分割线以下的模板除了「 补充信息」每一样都必填

如果不满足以上两点要求的 bug 报告,issue 会被直接关掉。

请多多理解,您现在的不便将会使 Taro 开发者更高效地定位你的问题,修复你的问题。像你一样的 Taro 的使用者也可以通过搜索找到你提供的 bug,对各方都有很大好处。

🙏🙏🙏
阅读完后请在提交的issue中删除以上内容,包括分割线。

问题描述
在组件上加的onXXX事件名, 转换后, 任然保留了on前缀

复现步骤
[复现问题的步骤]

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

[或者可以直接贴源代码,能贴文字就不要截图]

<van-tabs onChange={this.props.change} custom-class="fixed">
                    <van-tab title="已上架" />
                    <van-tab title="未上架" />
                </van-tabs>

期望行为
转换后变为bindchange

报错信息
转换后变成bindonchange
image

[这里请贴上你的完整报错截图或文字]

系统信息

 Taro CLI 1.2.13 environment info:
    System:
      OS: macOS High Sierra 10.13.6
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 11.9.0 - /usr/local/bin/node
      Yarn: 1.3.2 - /usr/local/bin/yarn
      npm: 6.5.0 - /usr/local/bin/npm
    npmPackages:
      @tarojs/async-await: 1.2.12 => 1.2.12 
      @tarojs/components: 1.2.12 => 1.2.12 
      @tarojs/plugin-babel: 1.2.12 => 1.2.12 
      @tarojs/plugin-csso: 1.2.12 => 1.2.12 
      @tarojs/plugin-less: 1.2.12 => 1.2.12 
      @tarojs/plugin-uglifyjs: 1.2.12 => 1.2.12 
      @tarojs/redux: 1.2.12 => 1.2.12 
      @tarojs/redux-h5: 1.2.12 => 1.2.12 
      @tarojs/router: 1.2.12 => 1.2.12 
      @tarojs/taro: 1.2.12 => 1.2.12 
      @tarojs/taro-alipay: 1.2.12 => 1.2.12 
      @tarojs/taro-h5: 1.2.12 => 1.2.12 
      @tarojs/taro-swan: 1.2.12 => 1.2.12 
      @tarojs/taro-tt: ^1.2.1 => 1.2.13 
      @tarojs/taro-weapp: 1.2.12 => 1.2.12 
      @tarojs/webpack-runner: 1.2.12 => 1.2.12 
      nervjs: ^1.3.9 => 1.3.12 
  • 操作系统: [e.g. Windows 10]
  • Taro 版本 [e.g. v.0.0.64]
  • Node.js 版本 [e.g. v9.0.0]
  • 报错平台 [h5, weapp]

补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]

@taro-bot
Copy link

taro-bot bot commented Feb 16, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@uxiew
Copy link

uxiew commented Feb 17, 2019

以前有帖子说过:目前只支持原生的微信小程序转化,有赞的不支持。
关于你的问题,我觉得吧,可以试着 修改 项目包中的tabs下index.js 源码:

setActive: function setActive(active) {
      if (active !== this.data.active) {
        this.trigger('change', active);  // change => onchange
        this.set({
          active: active
        });
        this.setActiveTab();
      }
    },

@luckyadam
Copy link
Member

贴一下你的完整代码

@binlaniua
Copy link
Author

binlaniua commented Feb 18, 2019

以前有帖子说过:目前只支持原生的微信小程序转化,有赞的不支持。
关于你的问题,我觉得吧,可以试着 修改 项目包中的tabs下index.js 源码:

setActive: function setActive(active) {
      if (active !== this.data.active) {
        this.trigger('change', active);  // change => onchange
        this.set({
          active: active
        });
        this.setActiveTab();
      }
    },

好像不是这个问题, on应该在编译后去掉的, 升级了taro出现这个问题了

@binlaniua
Copy link
Author

贴一下你的完整代码

image

@yuche
Copy link
Contributor

yuche commented Jul 16, 2019

close via 011dd77

@yuche yuche closed this as completed Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants