Answer the question
In order to leave comments, you need to log in
Is it possible to nest a method in an object in vue?
Now I use a method call like this
I want to call a method like this
The current structure of methods:
<button @click="packet().send()">Send</button>
<button @click="packet.send()">Send</button>
new Vue({
methods: {
packet() {
return {
send() {},
recieve() {}
}
}
}
})
[Vue warn]: Method "packet" has type "object" in the component definition. Did you reference the function correctly?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question