feat: update header and insertForm components

This commit is contained in:
yanglbme 2020-09-02 20:39:47 +08:00
parent 62565c1186
commit eacc33c598
2 changed files with 8 additions and 5 deletions

View File

@ -55,9 +55,9 @@
</el-tooltip> </el-tooltip>
<el-button :type="btnType" plain size="medium" @click="copy" placement="bottom-start">复制</el-button> <el-button :type="btnType" plain size="medium" @click="copy" placement="bottom-start">复制</el-button>
<el-button :type="btnType" plain size="medium" class="about" @click="$emit('showAboutDialog')">关于</el-button> <el-button :type="btnType" plain size="medium" class="about" @click="$emit('showAboutDialog')">关于</el-button>
<el-tooltip content="夜间模式" placement="bottom-start"> <el-tooltip :content="btnContent" :effect="effect" placement="bottom-start">
<div class="mode__switch" v-if="!nightMode" @click="themeChanged"></div> <div class="mode__switch mode__switch_black" v-if="nightMode" @click="themeChanged"></div>
<div class="mode__switch mode__switch_black" v-else @click="themeChanged"></div> <div class="mode__switch" v-else @click="themeChanged"></div>
</el-tooltip> </el-tooltip>
<resetDialog :showResetConfirm="showResetConfirm" @confirm="confirmReset" @close="cancelReset"/> <resetDialog :showResetConfirm="showResetConfirm" @confirm="confirmReset" @close="cancelReset"/>
</el-container> </el-container>
@ -99,6 +99,9 @@ export default {
effect() { effect() {
return this.nightMode ? 'dark' : 'light' return this.nightMode ? 'dark' : 'light'
}, },
btnContent() {
return this.nightMode ? '浅色模式' : '暗黑模式'
},
btnType() { btnType() {
return this.nightMode ? 'default' : 'primary'; return this.nightMode ? 'default' : 'primary';
}, },

View File

@ -8,7 +8,7 @@
> >
<el-row class="tb-options" type="flex" align="middle" :gutter="10"> <el-row class="tb-options" type="flex" align="middle" :gutter="10">
<el-col :span="6"> <el-col :span="6">
<el-input-number <el-input-number
v-model="rowNum" v-model="rowNum"
controls-position="right" controls-position="right"
@ -19,7 +19,7 @@
></el-input-number> ></el-input-number>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-input-number <el-input-number
v-model="colNum" v-model="colNum"
controls-position="right" controls-position="right"