|
@@ -66,6 +66,17 @@ const comT = () => {
|
|
|
//跳转到首页
|
|
|
router.push({ name: 'homeView' })
|
|
|
}
|
|
|
+//设置显示字段长度
|
|
|
+const formatterName = (val: string) => {
|
|
|
+ if (val == undefined) {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ if (val.length > 4) {
|
|
|
+ return val.substring(0, 3) + '...'
|
|
|
+ } else {
|
|
|
+ return val
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -95,7 +106,7 @@ const comT = () => {
|
|
|
<div class="login_button_bg" @mouseenter="comeMenu" @mouseleave="leaveMenu" v-show="userInfo.userInfo.userName">
|
|
|
<img width="20px" src="../assets/home/button_login.png" />
|
|
|
|
|
|
- <span>{{ userInfo.userInfo.userName }}</span>
|
|
|
+ <span :title="userInfo.userInfo.userName">{{ formatterName(userInfo.userInfo.userName) }}</span>
|
|
|
<transition>
|
|
|
<div class="login_user" v-show="falgMenu">
|
|
|
<div class="update_pass" @click="updatePassFun">
|