vue3
This commit is contained in:
@@ -28,6 +28,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async fetchData() {
|
||||
console.log('fetch data')
|
||||
if (this.window.label) {
|
||||
this.loading = true
|
||||
const typeApi = {
|
||||
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
if (!this.activeType) {
|
||||
this.$emit('setType', this.navTypes[0])
|
||||
this.$emit('set-type', this.navTypes[0])
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -58,7 +58,7 @@ export default {
|
||||
},
|
||||
setType(type) {
|
||||
this.toggled = false
|
||||
this.$emit('setType', type)
|
||||
this.$emit('set-type', type)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<li
|
||||
v-for="window in windows"
|
||||
:key="window.label"
|
||||
@click="$emit('setWindow', window)"
|
||||
@click="$emit('set-window', window)"
|
||||
:class="{'is-active': window.label === activeWindow.label}"
|
||||
>
|
||||
<a>{{window.label}}</a>
|
||||
@@ -68,11 +68,12 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log('mounted')
|
||||
if (typeof this.activeWindow === 'string') {
|
||||
const window = this.windows.find(w => w.label === this.activeWindow.replace('-', ' '))
|
||||
this.$emit('setWindow', window)
|
||||
this.$emit('set-window', window)
|
||||
} else if (!this.activeWindow.label) {
|
||||
this.$emit('setWindow', this.windows[1])
|
||||
this.$emit('set-window', this.windows[1])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user