Upgrade build libs and fixed lints (#235)
This commit is contained in:
1 parent
8bf60b4b05
commit
03244e096f
197 files changed
+3924
-3714
No files matched your search
@@ -21,8 +21,9 @@ export default defineComponent({
|
||||
},
|
||||
props: {
|
||||
content: {
|
||||
type: String,
|
||||
required: true
|
||||
type: [String, Number],
|
||||
required: false,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -32,7 +33,10 @@ export default defineComponent({
|
||||
},
|
||||
methods: {
|
||||
onCopy() {
|
||||
copy(this.content, {
|
||||
if (!this.content) {
|
||||
return;
|
||||
}
|
||||
copy(this.content.toString(), {
|
||||
debug: true
|
||||
});
|
||||
this.copied = true;
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
<template>
|
||||
<el-dialog :model-value="visible" :width="200" class="text-center" @close="$emit('close')">
|
||||
<dark-switch class="switch" dark-background="#333" light-background="#fff" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { getDomain } from '@/utils';
|
||||
import { getCookie, setCookie } from 'typescript-cookie';
|
||||
import { defineComponent } from 'vue';
|
||||
import { Switch as DarkSwitch, toggleDark, isDark } from 'vue-dark-switch';
|
||||
import { ElDialog } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
DarkSwitch,
|
||||
ElDialog
|
||||
},
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
emits: ['update:dark', 'close'],
|
||||
computed: {
|
||||
dark() {
|
||||
return getCookie('THEME') === 'dark';
|
||||
},
|
||||
switchValue() {
|
||||
return isDark.value;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
switchValue(val) {
|
||||
this.setCookie(val);
|
||||
},
|
||||
dark(val) {
|
||||
document.documentElement.classList.toggle('dark', val);
|
||||
this.setCookie(this.dark);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.dark) {
|
||||
toggleDark(true);
|
||||
document.documentElement.classList.add('dark');
|
||||
} else {
|
||||
toggleDark(false);
|
||||
document.documentElement.classList.remove('dark');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setCookie(isDark: boolean) {
|
||||
setCookie('THEME', isDark ? 'dark' : 'light', {
|
||||
path: '/',
|
||||
domain: getDomain()
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.switch {
|
||||
--n-rail-color-active: var(--el-color-primary) !important;
|
||||
--n-loading-color: var(--el-color-primary) !important;
|
||||
border-radius: 10px !important;
|
||||
border: 1px solid var(--el-border-color);
|
||||
overflow: hidden;
|
||||
.n-switch__button {
|
||||
border-radius: 50% !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -40,7 +40,8 @@ export default defineComponent({
|
||||
},
|
||||
percentage: {
|
||||
type: Number,
|
||||
required: true
|
||||
required: false,
|
||||
default: undefined
|
||||
},
|
||||
closable: {
|
||||
type: Boolean,
|
||||
|
||||
@@ -36,7 +36,8 @@ export default defineComponent({
|
||||
},
|
||||
percentage: {
|
||||
type: Number,
|
||||
required: true
|
||||
required: false,
|
||||
default: undefined
|
||||
},
|
||||
closable: {
|
||||
type: Boolean,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { getPriceString } from '@/utils';
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
</el-col>
|
||||
<el-col :md="16" :xs="13">
|
||||
<el-menu :default-active="active" mode="horizontal" class="menu" :ellipsis="true" @select="onSelect">
|
||||
<el-sub-menu :index="1">
|
||||
<el-sub-menu :index="products">
|
||||
<template #title>{{ $t('common.nav.products') }}</template>
|
||||
<el-menu-item v-if="site?.features?.chat?.enabled" v-t="'index.title.chat'" index="/chat"></el-menu-item>
|
||||
<el-menu-item v-if="site?.features?.chatgpt?.enabled" v-t="'index.title.chat'" index="/chat"></el-menu-item>
|
||||
<el-menu-item
|
||||
v-if="site?.features?.midjourney?.enabled"
|
||||
v-t="'index.title.midjourney'"
|
||||
@@ -88,7 +88,8 @@ export default defineComponent({
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultAvatar
|
||||
defaultAvatar,
|
||||
products: 'chat'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
Reference in new issue
Block a user