文件上传区域展开bug修复

This commit is contained in:
FengHui
2026-04-03 19:22:20 +08:00
parent db9707e866
commit 15668dc769
2 changed files with 35 additions and 6 deletions

View File

@@ -8,7 +8,7 @@
</template>
<script setup>
import { ref, watch, nextTick } from 'vue';
import { ref, watch, nextTick, getCurrentInstance } from 'vue';
const props = defineProps({
show: Boolean,
@@ -26,11 +26,18 @@ const wrapStyle = ref({
});
const contentRef = ref(null);
const instance = getCurrentInstance();
// 获取高度(兼容 H5 + 小程序)
function getContentHeight() {
return new Promise((resolve) => {
const query = uni.createSelectorQuery().in(this ? this : undefined);
let query;
// #ifdef MP-WEIXIN
query = uni.createSelectorQuery().in(instance);
// #endif
// #ifndef MP-WEIXIN
query = uni.createSelectorQuery();
// #endif
query
.select('.content-inner')
.boundingClientRect((data) => {