perf: add eslint import rules, improve the coupling of some components
This commit is contained in:
@@ -8,7 +8,6 @@ import { createI18n } from 'vue-i18n';
|
||||
|
||||
const loadedLanguages = new Set<string>();
|
||||
|
||||
// TODO:import.meta.env,会导致该包依赖外部项目必须是vite才可以
|
||||
const i18n = createI18n({
|
||||
globalInjection: true,
|
||||
legacy: false,
|
||||
|
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* 获取元素可见高度
|
||||
* @param element
|
||||
* @returns
|
||||
*/
|
||||
function getElementVisibleHeight(
|
||||
element?: HTMLElement | null | undefined,
|
||||
|
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-restricted-imports */
|
||||
import type { RouteMeta as IRouteMeta } from '@vben-core/typings';
|
||||
|
||||
import 'vue-router';
|
||||
|
@@ -1,16 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
import { Toaster } from '@vben-core/shadcn-ui';
|
||||
|
||||
import { CozeAssistant } from '../coze-assistant';
|
||||
|
||||
interface Props {
|
||||
enableAiAssistant?: boolean;
|
||||
isMobile?: boolean;
|
||||
}
|
||||
|
||||
defineOptions({ name: 'GlobalProvider' });
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
enableAiAssistant: false,
|
||||
isMobile: false,
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<Toaster />
|
||||
<CozeAssistant
|
||||
v-if="preferences.app.aiAssistant"
|
||||
:is-mobile="preferences.app.isMobile"
|
||||
/>
|
||||
<CozeAssistant v-if="enableAiAssistant" :is-mobile="isMobile" />
|
||||
<slot></slot>
|
||||
</template>
|
||||
|
@@ -26,7 +26,7 @@ const emit = defineEmits<{ close: [] }>();
|
||||
|
||||
const router = useRouter();
|
||||
const searchHistory = useLocalStorage<MenuRecordRaw[]>(
|
||||
`__search-history-${import.meta.env.PROD ? 'prod' : 'dev'}__`,
|
||||
`__search-history-${location.hostname}__`,
|
||||
[],
|
||||
);
|
||||
const activeIndex = ref(-1);
|
||||
|
Reference in New Issue
Block a user