G
G
gifon2022-01-15 13:44:11
Vue.js
gifon, 2022-01-15 13:44:11

How can vue 3 hooks be used in main.ts?

Hello, in my examples for vue 2 (for pre-rendering) I often use an event
like

new Vue({
  el: '#app',
  router,
  render: h => h(App),
  mounted () {
    document.dispatchEvent(new Event('render-event'))
  }
})

https://github.com/chrisvfritz/prerender-spa-plugi...
But how can I make the same event on vue 3 + ts right)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2022-01-15
@gifon

That is about the same
https://v3.vuejs.org/guide/instance.html#lifecycle...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question