diff --git a/src/components/YlTable/yl-table-h.vue b/src/components/YlTable/yl-table-h.vue index 585b1d1..6356b5f 100644 --- a/src/components/YlTable/yl-table-h.vue +++ b/src/components/YlTable/yl-table-h.vue @@ -34,15 +34,15 @@ function handleTouchMove(event: TouchEvent) { watch( () => data.value, (newVal) => { + let width = document.getElementsByClassName('doc_content')[0]?.clientWidth + ? document.getElementsByClassName('doc_content')[0]?.clientWidth + : document.body.clientWidth; tableWidth.value = prop.value.length * 100; if (prop.value.length <= 3) { // tableWidth.value 判断是否铺满横屏 没有就铺满 - tableWidth.value = document.documentElement.clientWidth - 60; + tableWidth.value = width; } else { - tableWidth.value = - document.documentElement.clientWidth - 60 - prop.value.length * 100 > 0 - ? document.documentElement.clientWidth - : prop.value.length * 100; + tableWidth.value = width - prop.value.length * 100 > 0 ? width : prop.value.length * 100; } }, { @@ -58,6 +58,7 @@ watch( ref="doc_content" @touchstart="handleTouchStart" @touchmove="handleTouchMove" + class="doc_content" >
@@ -78,7 +78,7 @@ @blur="handleMaxSizeBlur" @update:model-value=" (value) => { - actionQuestion.config.max_size = value === '' ? 0 : value; + actionQuestion.config.max_size = value === '' ? 1 : value; } " >