feat: 剔除vxe强依赖

This commit is contained in:
xiaoxian521 2021-11-03 23:55:18 +08:00
parent 8436f964e4
commit 54a0e457b4
2 changed files with 46 additions and 29 deletions

View File

@ -140,7 +140,7 @@ function onReset() {
router.push("/login"); router.push("/login");
} }
function onChange({ label }) { function onChange(label) {
storageLocal.setItem("showModel", label); storageLocal.setItem("showModel", label);
emitter.emit("tagViewsShowModel", label); emitter.emit("tagViewsShowModel", label);
} }
@ -258,60 +258,73 @@ function setLayoutThemeColor(theme: string) {
<ul class="setting"> <ul class="setting">
<li> <li>
<span>灰色模式</span> <span>灰色模式</span>
<vxe-switch <el-switch
v-model="settings.greyVal" v-model="settings.greyVal"
open-label="开" inline-prompt
close-label="关" inactive-color="#a6a6a6"
active-text="开"
inactive-text="关"
@change="greyChange" @change="greyChange"
></vxe-switch> >
</el-switch>
</li> </li>
<li> <li>
<span>色弱模式</span> <span>色弱模式</span>
<vxe-switch <el-switch
v-model="settings.weekVal" v-model="settings.weekVal"
open-label="开" inline-prompt
close-label="关" inactive-color="#a6a6a6"
active-text="开"
inactive-text="关"
@change="weekChange" @change="weekChange"
></vxe-switch> >
</el-switch>
</li> </li>
<li> <li>
<span>隐藏标签页</span> <span>隐藏标签页</span>
<vxe-switch <el-switch
v-model="settings.tagsVal" v-model="settings.tagsVal"
open-label="开" inline-prompt
close-label="关" inactive-color="#a6a6a6"
active-text="开"
inactive-text="关"
@change="tagsChange" @change="tagsChange"
></vxe-switch> >
</el-switch>
</li> </li>
<li> <li>
<span>侧边栏Logo</span> <span>侧边栏Logo</span>
<vxe-switch <el-switch
v-model="logoVal" v-model="logoVal"
open-value="1" inline-prompt
close-value="-1" active-value="1"
open-label="开" inactive-value="-1"
close-label="关" inactive-color="#a6a6a6"
active-text="开"
inactive-text="关"
@change="logoChange" @change="logoChange"
></vxe-switch> >
</el-switch>
</li> </li>
<li> <li>
<span>标签风格</span> <span>标签风格</span>
<vxe-radio-group v-model="markValue" @change="onChange"> <el-radio-group v-model="markValue" size="small" @change="onChange">
<vxe-radio label="card" content="卡片"></vxe-radio> <el-radio label="card">卡片</el-radio>
<vxe-radio label="smart" content="灵动"></vxe-radio> <el-radio label="smart">灵动</el-radio>
</vxe-radio-group> </el-radio-group>
</li> </li>
</ul> </ul>
<el-divider /> <el-divider />
<vxe-button <el-button
status="danger" type="danger"
style="width: 90%; margin: 24px 15px" style="width: 90%; margin: 24px 15px"
content="清空缓存并返回登录页"
icon="fa fa-sign-out"
@click="onReset" @click="onReset"
></vxe-button> >
<i class="fa fa-sign-out"></i>
清空缓存并返回登录页</el-button
>
</panel> </panel>
</template> </template>

View File

@ -30,11 +30,13 @@ import {
ElDrawer, ElDrawer,
ElPagination, ElPagination,
ElAlert, ElAlert,
ElRadio,
ElRadioButton, ElRadioButton,
ElRadioGroup, ElRadioGroup,
ElDescriptions, ElDescriptions,
ElDescriptionsItem, ElDescriptionsItem,
ElBacktop ElBacktop,
ElSwitch
} from "element-plus"; } from "element-plus";
// https://element-plus.org/zh-CN/component/icon.html // https://element-plus.org/zh-CN/component/icon.html
@ -85,11 +87,13 @@ const components = [
ElDrawer, ElDrawer,
ElPagination, ElPagination,
ElAlert, ElAlert,
ElRadio,
ElRadioButton, ElRadioButton,
ElRadioGroup, ElRadioGroup,
ElDescriptions, ElDescriptions,
ElDescriptionsItem, ElDescriptionsItem,
ElBacktop, ElBacktop,
ElSwitch,
// icon // icon
Check, Check,