Skip to content
Advertisement

Is there way to hook vue component ready (initialize)

see my demo, I hope hook component ready with following code:

JavaScript

the ready function isn’t invoked.

Advertisement

Answer

ready has been replaced with mounted hook in vue 2.x.x. you can use mounted hook which gets:

Called after the instance has just been mounted where el is replaced by the newly created vm.$el

see updated fiddle.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement