mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-14 15:26:56 +08:00
Merge 87102caaf4520ab3c55906a2a94f11cb625811a0 into 2053491782949b7b904dcfe974126e3a37bf4007
This commit is contained in:
commit
2871d59d43
@ -50,7 +50,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-avatar>
|
</a-avatar>
|
||||||
</template>
|
</template>
|
||||||
<template #title>{{ perf.custom.username }}</template>
|
<template #title>{{ computedUsername }}</template>
|
||||||
<a-menu-item key="settings">
|
<a-menu-item key="settings">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<SettingOutlined />
|
<SettingOutlined />
|
||||||
@ -97,6 +97,7 @@ import {
|
|||||||
import { useStore } from 'vuex';
|
import { useStore } from 'vuex';
|
||||||
import localConfig from '@/confOp';
|
import localConfig from '@/confOp';
|
||||||
|
|
||||||
|
const MAX_USERNAME_LEN = 5;// 最大展示的用户名长度
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const active = computed(() => store.state.active);
|
const active = computed(() => store.state.active);
|
||||||
@ -106,6 +107,15 @@ const changeMenu = (key: any) => {
|
|||||||
store.commit('commonUpdate', {active: [key]})
|
store.commit('commonUpdate', {active: [key]})
|
||||||
router.push(key);
|
router.push(key);
|
||||||
};
|
};
|
||||||
|
const computedUsername = computed(() => {
|
||||||
|
const originUsername = perf?.custom?.username;
|
||||||
|
if (typeof originUsername === 'string'){
|
||||||
|
return originUsername.length > MAX_USERNAME_LEN
|
||||||
|
? `${originUsername.slice(0, MAX_USERNAME_LEN)}...`
|
||||||
|
: originUsername;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
window.rubick.onPluginEnter(({ code }: { code: string }) => {
|
window.rubick.onPluginEnter(({ code }: { code: string }) => {
|
||||||
code = code === '已安装插件' ? 'installed' : code;
|
code = code === '已安装插件' ? 'installed' : code;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user