perf(i18n): merge common lang

This commit is contained in:
vben
2021-01-12 21:10:27 +08:00
parent fb57cf734d
commit efbde0d57e
47 changed files with 175 additions and 102 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div :class="prefixCls" v-if="getShowSearch" @click.stop="handleSearch">
<Tooltip>
<template #title> {{ t('component.app.search') }} </template>
<template #title> {{ t('common.searchText') }} </template>
<SearchOutlined />
</Tooltip>

View File

@@ -15,7 +15,7 @@
<span :class="`${prefixCls}__item`">
<g-icon icon="mdi:keyboard-esc" />
</span>
<span>{{ t('component.app.toClose') }}</span>
<span>{{ t('common.closeText') }}</span>
</div>
</template>
<script lang="ts">
@@ -47,7 +47,7 @@
font-size: 12px;
color: #666;
background: rgb(255 255 255);
border-radius: 0 0 8px 8px;
border-radius: 0 0 16px 16px;
box-shadow: 0 -1px 0 0 #e0e3e8, 0 -3px 6px 0 rgba(69, 98, 155, 0.12);
align-items: center;
flex-shrink: 0;

View File

@@ -7,7 +7,7 @@
<div :class="`${prefixCls}-input__wrapper`">
<a-input
:class="`${prefixCls}-input`"
:placeholder="t('component.app.search')"
:placeholder="t('common.searchText')"
allow-clear
@change="handleSearch"
>
@@ -16,7 +16,7 @@
</template>
</a-input>
<span :class="`${prefixCls}-cancel`" @click="handleClose">{{
t('component.app.cancel')
t('common.cancelText')
}}</span>
</div>
@@ -116,6 +116,7 @@
scrollWrap,
handleMouseenter,
handleClose: () => {
searchResult.value = [];
emit('close');
},
};
@@ -135,7 +136,7 @@
height: 100%;
padding-top: 50px;
// background: #656c85cc;
background: rgba(0, 0, 0, 0.8);
background: rgba(0, 0, 0, 0.25);
justify-content: center;
// backdrop-filter: blur(2px);
@@ -178,12 +179,13 @@
&-content {
position: relative;
width: 532px;
width: 632px;
// padding: 14px;
margin: 0 auto auto auto;
background: #f5f6f7;
border-radius: 6px;
box-shadow: inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.5), 0 3px 8px 0 #555a64;
border-radius: 16px;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
// box-shadow: inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.5), 0 3px 8px 0 #555a64;
flex-direction: column;
}
@@ -196,9 +198,10 @@
&-input {
width: 100%;
height: 56px;
height: 48px;
font-size: 1.5em;
color: #1c1e21;
border-radius: 6px;
span[role='img'] {
color: #999;

View File

@@ -1,5 +1,5 @@
import { cloneDeep } from 'lodash-es';
import { ref, onBeforeMount, unref, Ref } from 'vue';
import { ref, onBeforeMount, unref, Ref, nextTick } from 'vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { getMenus } from '/@/router/menus';
import type { Menu } from '/@/router/types';
@@ -130,7 +130,7 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
start();
}
function handleEnter() {
async function handleEnter() {
if (!searchResult.value.length) return;
const result = unref(searchResult);
const index = unref(activeIndex);
@@ -139,10 +139,12 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
}
const to = result[index];
handleClose();
await nextTick();
go(to.path);
}
function handleClose() {
searchResult.value = [];
emit('close');
}