helpers.js 336 B

123456789101112131415161718192021
  1. import { createApp } from 'vue'
  2. export function mount (store, component) {
  3. const el = createElement()
  4. component.render = () => {}
  5. const app = createApp(component)
  6. app.use(store)
  7. return app.mount(el)
  8. }
  9. function createElement () {
  10. const el = document.createElement('div')
  11. document.body.appendChild(el)
  12. return el
  13. }