Skip to content

28.子组件向父组件传递数据 #28

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

Open
webVueBlog opened this issue Mar 12, 2020 · 1 comment
Open

28.子组件向父组件传递数据 #28

webVueBlog opened this issue Mar 12, 2020 · 1 comment
Labels
组件问题 组件问题

Comments

@webVueBlog
Copy link
Member

No description provided.

@webVueBlog webVueBlog added the 组件问题 组件问题 label Mar 12, 2020
@webVueBlog
Copy link
Member Author

子组件:

// tabbar点击事件
tabbar(index){
 this.$emit('tabtap', index); // 子组件向父传值
}

父组件:

<tabar
 ...
 @tabtap = "tabweb">
</taber>

tabweb(index){
 this.tabIndex = index;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
组件问题 组件问题
Projects
None yet
Development

No branches or pull requests

1 participant