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
虽然我们日常大多数会用element-ui或者iview等等ui框架,但是总有些业务场景,我们需要在子组件传递给我的参数中增加一些参数进行判断等等,那么该怎么写呢? 其实之前有百度查到过,但一段时间不写或者项目很忙大脑转不过来时就容易忘,所以记录下。 具体看:vuejs/vue#5735 举个例子: 子组件
<template> <div> <input @change="change"/> </div> </template> <script> export default { name: 'child', methods: { change (e) { this.$emit('input', e) } } } </script>
父组件:
<template> <div> <child @input="value => input(value, 新参数)"/> </div> </template> <script> import Child from './child' export default { name: 'parent', components: {child} methods: { input (value, 新参数) { console.log(value, 新参数) } } } </script>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
虽然我们日常大多数会用element-ui或者iview等等ui框架,但是总有些业务场景,我们需要在子组件传递给我的参数中增加一些参数进行判断等等,那么该怎么写呢?
其实之前有百度查到过,但一段时间不写或者项目很忙大脑转不过来时就容易忘,所以记录下。
具体看:vuejs/vue#5735
举个例子:
子组件
父组件:
The text was updated successfully, but these errors were encountered: