Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. /**
  2. * ドキュメント外で描画する
  3. * @param component Vueコンポーネント
  4. * @param id 該当ID
  5. * @constructor
  6. */
  7. export const appendVueComponent = (component: VueConstructor, id: string) => {
  8. const ComponentClass = Vue.extend(component)
  9. const ComponentInstance = new ComponentClass().$mount()
  10. if (document.getElementById(id) != null) {
  11. document.getElementById(id).appendChild(ComponentInstance.$el)
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement