tiptap/docs/src/main.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-03-05 16:18:17 +08:00
import Prism from 'prismjs'
2020-04-17 03:12:31 +08:00
import 'prismjs/components/prism-jsx.js'
2020-11-18 21:37:35 +08:00
import 'prismjs/components/prism-typescript.js'
2020-04-18 05:35:07 +08:00
import 'prismjs/components/prism-scss.js'
2020-10-13 00:42:47 +08:00
import PortalVue from 'portal-vue'
2021-01-30 03:56:53 +08:00
import iframeResize from 'iframe-resizer/js/iframeResizer'
2020-04-17 23:06:55 +08:00
import App from '~/layouts/App'
2019-12-08 04:02:22 +08:00
2020-11-19 00:52:23 +08:00
Prism.manual = true
2020-11-07 03:14:06 +08:00
export default function (Vue, { head }) {
head.htmlAttrs = { 'data-theme': 'dark' }
2020-12-01 17:25:00 +08:00
// fix docsearch
2020-12-02 00:33:20 +08:00
if (typeof window === 'object' && !window.process) {
2020-12-01 17:25:00 +08:00
window.process = {
env: {
NODE_ENV: 'production',
},
}
}
2020-10-13 00:42:47 +08:00
Vue.use(PortalVue)
2021-01-30 03:56:53 +08:00
Vue.directive('resize', {
2021-02-02 18:37:24 +08:00
bind: (el, { value = {} }) => {
el.addEventListener('load', () => {
iframeResize({
...value,
messageCallback(messageData) {
if (messageData.message === 'resize') {
el.iFrameResizer.resize()
}
},
}, el)
})
2021-01-30 03:56:53 +08:00
},
unbind(el) {
el.iFrameResizer.removeListeners()
},
})
2020-04-17 23:06:55 +08:00
Vue.component('Layout', App)
2020-10-02 16:55:55 +08:00
Vue.component('Demo', () => import(/* webpackChunkName: "demo" */ '~/components/Demo'))
Vue.component('LiveDemo', () => import(/* webpackChunkName: "live-demo" */ '~/components/LiveDemo'))
2019-12-08 04:02:22 +08:00
}