tiptap/demos/setup/vue.ts
Raman Paulau f7f644f7b2
fix(vue-3): set editor's appContext.provide to forward inject chain (#5397)
Vue internally uses prototype chain to preserve injects across the entire component chain. Thus should avoid Object.assign or spread operator as it won't copy the prototype. All correct provides will be already present on `instance.provides`.
2024-07-29 17:02:15 +02:00

26 lines
634 B
TypeScript

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