We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
总结下在vue 中使用 jsx 的技巧。
默认jsx 中绑定事件的语法为 onXx。如:
// child comp ... name:"child-comp" mounted:{ this.emit("valueChange",args) } ...
绑定子组件的事件
// parent comp ... methods:{ change(){} }, render(){ return <child-comp onValueChange={()=>this.change()} /> } ...
如果子组件抛出的事件名本身就是以 on 开头,则需要换种方法绑定子组件事件。如:
// child comp ... name:"child-comp" mounted:{ this.emit("onValueChange",args) } ...
使用propsXx绑定子组件的事件
propsXx
// parent comp ... methods:{ change(){} }, render(){ return <child-comp propsOnValueChange={()=>this.change()} /> } ...
或者使用展开绑定子组件的事件
// parent comp ... methods:{ change(){} }, render(){ return <child-comp { ...{ props:{ onValueChange={()=>this.change()} } } } /> } ...
更新中...
The text was updated successfully, but these errors were encountered:
No branches or pull requests
前言
总结下在vue 中使用 jsx 的技巧。
jsx 绑定事件
默认jsx 中绑定事件的语法为 onXx。如:
绑定子组件的事件
如果子组件抛出的事件名本身就是以 on 开头,则需要换种方法绑定子组件事件。如:
使用
propsXx
绑定子组件的事件或者使用展开绑定子组件的事件
更新中...
The text was updated successfully, but these errors were encountered: