tiptap/src/main.js

13 lines
417 B
JavaScript
Raw Normal View History

2020-03-05 16:18:17 +08:00
import Prism from 'prismjs'
2019-12-08 04:02:22 +08:00
import 'prismjs/themes/prism-okaidia.css'
import DefaultLayout from '~/layouts/Default.vue'
2020-03-27 20:21:59 +08:00
import Demo from '~/components/Demo'
2019-12-08 04:02:22 +08:00
export default function (Vue, { router, head, isClient }) {
2020-03-05 16:18:17 +08:00
Vue.component('Layout', DefaultLayout)
Vue.component('Demo', Demo)
2019-12-08 04:02:22 +08:00
Vue.filter('highlight', (code, lang = 'javascript') => {
return Prism.highlight(code, Prism.languages[lang], lang)
})
}