mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-23 17:07:49 +08:00
22 lines
539 B
TypeScript
22 lines
539 B
TypeScript
|
import 'iframe-resizer/js/iframeResizer.contentWindow'
|
||
|
import './style.scss'
|
||
|
|
||
|
import { debug, splitName } from './helper'
|
||
|
|
||
|
export default function init(name: string, source: any) {
|
||
|
// @ts-ignore
|
||
|
window.source = source
|
||
|
document.title = name
|
||
|
|
||
|
const [demoCategory, demoName] = splitName(name)
|
||
|
|
||
|
import(`../src/${demoCategory}/${demoName}/Svelte/index.svelte`)
|
||
|
.then(Module => {
|
||
|
const Component = Module.default
|
||
|
|
||
|
new Component({ target: document.querySelector('#app') }) // eslint-disable-line
|
||
|
|
||
|
debug()
|
||
|
})
|
||
|
}
|