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

why ? my argument ? #1783

Closed
premillos opened this issue Jan 2, 2019 · 2 comments
Closed

why ? my argument ? #1783

premillos opened this issue Jan 2, 2019 · 2 comments
Labels
question Further information is requested

Comments

@premillos
Copy link

premillos commented Jan 2, 2019

// 这里可以贴代码
type Props = {

}

type State = {

}

export default class Index extends Component<Props,State> {
  constructor () {
    super(...arguments)
    this.state = { name:'Hello world!' }
  }

  // 你可以通过 bind 传入多个参数
  preventPop (name, test, e) {    //事件对象 e 要放在最后
    e.preventDefault()
  }

  render () {
    return <Button onClick={this.preventPop.bind(this, this.state.name, 'test')}>123</Button>
  }
}

期望行为
可以正常的拿到事件函数的参数

报错信息
image

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

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。
Taro v1.2.3

Taro CLI 1.2.3 environment info:
System:
OS: macOS 10.14.1
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.8.0 - ~/.nvm/versions/node/v10.8.0/bin/node
Yarn: 1.9.4 - ~/.nvm/versions/node/v10.8.0/bin/yarn
npm: 6.5.0 - ~/.nvm/versions/node/v10.8.0/bin/npm
npmPackages:
@tarojs/components: ^1.1.9 => 1.2.3
@tarojs/mobx: ^1.2.3 => 1.2.3
@tarojs/plugin-babel: ^1.1.9 => 1.2.3
@tarojs/plugin-csso: ^1.1.9 => 1.2.3
@tarojs/plugin-less: ^1.1.9 => 1.2.3
@tarojs/plugin-uglifyjs: ^1.1.9 => 1.2.3
@tarojs/router: ^1.1.9 => 1.2.3
@tarojs/taro: ^1.1.9 => 1.2.3
@tarojs/taro-alipay: ^1.1.9 => 1.2.3
@tarojs/taro-h5: ^1.1.9 => 1.2.3
@tarojs/taro-swan: ^1.1.9 => 1.2.3
@tarojs/taro-weapp: ^1.1.9 => 1.2.3
@tarojs/webpack-runner: ^1.1.9 => 1.2.3
eslint-config-taro: ^1.1.9 => 1.2.3
eslint-plugin-taro: ^1.1.9 => 1.2.3

  • 报错平台 : weapp
@taro-bot
Copy link

taro-bot bot commented Jan 2, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@luckyadam
Copy link
Member

cli 和依赖都升级到最新版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants