[Vuejs]-Vue loses prototypes and imported files when creating new component

0👍

If you move the line

Vue.prototype.$hi = () => alert('hi');

above

let component = new TestComponent().$mount(wrapper)

it will work. Your first component references $hi() before it’s defined.

Leave a comment