update
This commit is contained in:
@@ -15,7 +15,11 @@
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
export default {
|
||||
props: ['activeWindow'],
|
||||
props: {
|
||||
activeWindow: {
|
||||
type: [Object, String]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
windows: [{
|
||||
@@ -64,7 +68,10 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.activeWindow.label) {
|
||||
if (typeof this.activeWindow === 'string') {
|
||||
const window = this.windows.find(w => w.label === this.activeWindow.replace('-', ' '))
|
||||
this.$emit('setWindow', window)
|
||||
} else if (!this.activeWindow.label) {
|
||||
this.$emit('setWindow', this.windows[1])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user