I have the following code(我有以下代码)
// child component
this.$emit('someEvent', 1, 2, 3)
// parent component
<child @someEvent="handleSomeEvent(arguments, 5,6)"></child>
methods: {
handleSomeEvent (arg, a, b) {
console.log(...arg); // 1,2,3
}
}
I want to know(我想知道)
- How does the code work?(代码如何工作?)
- Why we can get arguments?(为什么我们可以争论?)
I don't understand the principle, I cannot find answer form source code or internet.(我不了解原理,找不到源代码或互联网的答案。)
can anyone help me explain this, please.(谁能帮我解释一下。)
ask by lijiacong translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…