mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-27 06:41:12 +00:00
chore: 清理冗余代码与配置,优化项目结构
1. 删除无用文件与废弃代码:移除locale枚举、element-plus插件、sse路由、api token模块等 2. 简化类型导入与依赖:移除大量未使用的类型导入,统一echarts导入方式 3. 优化配置与样式:调整gitignore、样式引入顺序,新增列表动画样式 4. 修复接口与模型:修正接口返回类型、查询参数配置,更新部门模型字段 5. 优化性能与体验:添加图片懒加载,优化加载逻辑与表格渲染 6. 调整环境配置:新增并更新开发/生产环境配置文件
This commit is contained in:
@@ -23,13 +23,13 @@
|
||||
<!-- 原始内容 -->
|
||||
<span ref="textRef" class="inline-block">
|
||||
<slot>
|
||||
<span v-html="text"></span>
|
||||
<span v-html="sanitizedText"></span>
|
||||
</slot>
|
||||
</span>
|
||||
<!-- 克隆内容用于无缝循环 -->
|
||||
<span v-if="shouldClone" class="inline-block" :style="cloneSpacing">
|
||||
<slot>
|
||||
<span v-html="text"></span>
|
||||
<span v-html="sanitizedText"></span>
|
||||
</slot>
|
||||
</span>
|
||||
</div>
|
||||
@@ -48,6 +48,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch, onMounted, onBeforeUnmount } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import DOMPurify from "dompurify";
|
||||
import {
|
||||
useElementSize,
|
||||
useRafFn,
|
||||
@@ -117,7 +118,6 @@ const settingStore = useSettingsStore();
|
||||
const { isDark } = storeToRefs(settingStore);
|
||||
|
||||
const containerRef = ref<HTMLElement>();
|
||||
const contentRef = ref<HTMLElement>();
|
||||
const textRef = ref<HTMLElement>();
|
||||
const isReady = ref(false);
|
||||
|
||||
@@ -129,6 +129,8 @@ const shouldClone = ref(false);
|
||||
const isHorizontal = computed(() => props.direction === "left" || props.direction === "right");
|
||||
const isReverse = computed(() => props.direction === "right" || props.direction === "down");
|
||||
|
||||
const sanitizedText = computed(() => DOMPurify.sanitize(props.text));
|
||||
|
||||
// 使用 VueUse 的 useElementSize 监听容器尺寸变化
|
||||
const { width: containerWidth, height: containerHeight } = useElementSize(containerRef);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user