♻️ component

fix(utils): 调整计算内容高度公式中的偏移量

style(component): 移除 soulkey 的默认空字符串值

chore(component): 更新 layer-vue 依赖路径为本地路径

feat(layer): 为图片组件添加滚轮缩放功能

refactor(component): 优化 computedRefImpl 类的实现

docs(component): 更新依赖路径和版本信息

style(component): 统一 isObject 函数的命名和实现

refactor(component): 重构上传组件的代码结构
This commit is contained in:
2025-04-15 10:05:22 +08:00
parent 5c68a21ac2
commit d2b464242b
19 changed files with 2873 additions and 2823 deletions

View File

@@ -1,6 +1,11 @@
<template>
<div class="layui-layer-phimg">
<img :src="imgList[index].src" />
<!-- img 标签添加滚轮事件监听 -->
<img
:src="imgList[index].src"
@wheel.prevent="handleWheel"
:style="{ transform: `scale(${scale})` }"
/>
<div class="layui-layer-imgsee" v-if="imgList.length > 0">
<span class="layui-layer-imguide" v-if="imgList.length > 1">
<a
@@ -97,4 +102,14 @@ const ifSetThumb = computed(() => {
});
return res;
});
// 添加缩放比例的响应式变量
const scale = ref(1);
// 定义处理滚轮事件的方法
const handleWheel = (event: WheelEvent) => {
const delta = event.deltaY > 0 ? -0.1 : 0.1;
const newScale = scale.value + delta;
// 限制缩放范围
scale.value = Math.min(Math.max(newScale, 0.5), 3);
};
</script>

View File

@@ -145,7 +145,7 @@ export function calculateContent(
if (btn && btn.length > 0) {
if (type == 0) {
if (title) {
return "calc(" + height + " - 137px)";
return "calc(" + height + " - 90px)";
} else {
return "calc(" + height + " - 86px)";
}