mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 03:39:01 +08:00
Demo previews: Memorize active tab
This commit is contained in:
parent
996a2326c8
commit
a55aa5fd17
@ -120,6 +120,12 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
currentTab(newCurrentTab) {
|
||||
localStorage.tab = newCurrentTab
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
showTabs() {
|
||||
return this.sortedTabs.length > 1
|
||||
@ -226,7 +232,8 @@ export default {
|
||||
|
||||
mounted() {
|
||||
// TODO: load language from url params
|
||||
this.setTab(this.sortedTabs[0]?.name)
|
||||
const intitialTab = localStorage.tab ? localStorage.tab : this.sortedTabs[0]?.name
|
||||
this.setTab(intitialTab)
|
||||
|
||||
window.document.addEventListener('editor', this.onEditor, false)
|
||||
window.document.addEventListener('source', this.onSource, false)
|
||||
|
Loading…
Reference in New Issue
Block a user