Skip to content

Commit

Permalink
fix: Check lang installation before creating quasar-tip
Browse files Browse the repository at this point in the history
  • Loading branch information
mekery committed Apr 16, 2020
1 parent 1e2831c commit b0b28a0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Vue from 'vue'
import { QuasarTiptapPlugin } from './index'
Vue.use(QuasarTiptapPlugin, {
language: 'en-us',
language: 'zh-hans',
spellcheck: true
})
Expand Down
11 changes: 11 additions & 0 deletions src/components/QuasarTiptap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</template>

<script>
import Vue from 'vue'
import { Editor, EditorContent } from 'tiptap'
import {
BulletList,
Expand Down Expand Up @@ -78,6 +79,7 @@ import DynamicClass from 'src/extentions/dynamic'
import OEditorMenuBar from 'src/components/menubars/OEditorMenuBar'
import OEditorMenuBubble from 'src/components/menubars/OEditorMenuBubble'
import Lang from 'src/lang'
export default {
name: 'quasar-tiptap',
Expand Down Expand Up @@ -242,6 +244,15 @@ export default {
showSidePanel () {},
onSlideShow () {}
},
beforeCreate () {
if (!this.$o) {
let $o = {}
Lang.install($o, '')
Vue.prototype.$o = $o
} else {
console.log('Lang installed')
}
},
mounted: function () {
this.html = this.content
this.initEditor()
Expand Down
2 changes: 0 additions & 2 deletions src/components/views/OKatexBlockView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ export default {
} else {
this.renderKatex()
}
console.log('init', this.src)
}
},
renderKatex () {
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const QuasarTiptapPlugin = {

install (Vue, options = {}) {
$o.config = Object.freeze(options)
console.log('install plugin', $o)

this.spellcheck = options.spellcheck == null
? true
Expand Down

0 comments on commit b0b28a0

Please sign in to comment.