chore: fix bug

This commit is contained in:
syuilo 2021-10-12 00:44:52 +09:00
parent abd3efa318
commit 50bad84747
1 changed files with 76 additions and 58 deletions

View File

@ -1,4 +1,7 @@
<template> <template>
<div>
<MkHeader :info="header"/>
<div class="_root"> <div class="_root">
<MkA class="view" v-if="pageId" :to="`/@${ author.username }/pages/${ currentName }`"><i class="fas fa-external-link-square-alt"></i> {{ $ts._pages.viewPage }}</MkA> <MkA class="view" v-if="pageId" :to="`/@${ author.username }/pages/${ currentName }`"><i class="fas fa-external-link-square-alt"></i> {{ $ts._pages.viewPage }}</MkA>
@ -56,7 +59,7 @@
<XDraggable tag="div" class="variables" v-show="variables.length > 0" v-model="variables" item-key="name" handle=".drag-handle" :group="{ name: 'variables' }" animation="150" swap-threshold="0.5"> <XDraggable tag="div" class="variables" v-show="variables.length > 0" v-model="variables" item-key="name" handle=".drag-handle" :group="{ name: 'variables' }" animation="150" swap-threshold="0.5">
<template #item="{element}"> <template #item="{element}">
<XVariable <XVariable
:value="element" :modelValue="element"
:removable="true" :removable="true"
@remove="() => removeVariable(element)" @remove="() => removeVariable(element)"
:hpml="hpml" :hpml="hpml"
@ -77,6 +80,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -128,6 +132,21 @@ export default defineComponent({
data() { data() {
return { return {
[symbols.PAGE_INFO]: computed(() => { [symbols.PAGE_INFO]: computed(() => {
let title = this.$ts._pages.newPage;
if (this.initPageId) {
title = this.$ts._pages.editPage;
}
else if (this.initPageName && this.initUser) {
title = this.$ts._pages.readPage;
}
return {
title: title,
icon: 'fas fa-pencil-alt',
bg: 'var(--bg)',
};
}),
tab: 'settings',
header: computed(() => {
let title = this.$ts._pages.newPage; let title = this.$ts._pages.newPage;
if (this.initPageId) { if (this.initPageId) {
title = this.$ts._pages.editPage; title = this.$ts._pages.editPage;
@ -162,7 +181,6 @@ export default defineComponent({
}] }]
}; };
}), }),
tab: 'settings',
author: this.$i, author: this.$i,
readonly: false, readonly: false,
page: null, page: null,