tiptap/demos/setup/vue.ts

21 lines
515 B
TypeScript
Raw Normal View History

2021-08-25 17:52:20 +08:00
import 'iframe-resizer/js/iframeResizer.contentWindow'
import './style.scss'
import { createApp } from 'vue'
import { debug, splitName } from './helper.js'
2021-08-25 17:52:20 +08:00
export default function init(name: string, source: any) {
// @ts-ignore
window.source = source
document.title = name
const [demoCategory, demoName, frameworkName] = splitName(name)
2021-08-25 17:52:20 +08:00
import(`../src/${demoCategory}/${demoName}/${frameworkName}/index.vue`)
2021-08-25 17:52:20 +08:00
.then(module => {
createApp(module.default).mount('#app')
debug()
})
}