vm.$on( event, callback )
-
Arguments:
{String} event
{Function} callback
-
Usage:
Listen for a custom event on the current vm. Events can be triggered by
vm.$emit
,vm.$dispatch
orvm.$broadcast
. The callback will receive all the additional arguments passed into these event-triggering methods. -
Example:
12345vm.$on(
'test'
,
function
(msg) {
console.log(msg)
})
vm.$emit(
'test'
,
'hi'
)
// -> "hi"
Please login to continue.