stellar-ui-plus 1.23.3 → 1.23.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, ref, watch,
|
|
2
|
+
import { computed, ref, watch, useSlots, type CSSProperties, type Ref } from 'vue';
|
|
3
3
|
import type { Obj } from '../../types';
|
|
4
4
|
import propsData from './props';
|
|
5
5
|
import utils from '../../utils/utils';
|
|
@@ -31,6 +31,7 @@ const rowSpan = ref(false);
|
|
|
31
31
|
|
|
32
32
|
defineExpose({ row });
|
|
33
33
|
|
|
34
|
+
const slots = useSlots();
|
|
34
35
|
// 监听 row 数据变化,判断是否需要合并单元格
|
|
35
36
|
watch(
|
|
36
37
|
() => row.value[props.prop],
|
|
@@ -179,31 +180,15 @@ const finalPopoverLine = computed(() => {
|
|
|
179
180
|
</view>
|
|
180
181
|
</template>
|
|
181
182
|
<template v-else>
|
|
182
|
-
|
|
183
|
-
<template v-if="$slots.text">
|
|
184
|
-
<view class="cell-box">
|
|
185
|
-
<template v-if="!finalShowPopover">
|
|
186
|
-
<slot name="text" :row="row.row" :column="props"></slot>
|
|
187
|
-
</template>
|
|
188
|
-
<table-popover v-else :line="finalPopoverLine">
|
|
189
|
-
<slot name="text" :row="row.row" :column="props"></slot>
|
|
190
|
-
</table-popover>
|
|
191
|
-
</view>
|
|
192
|
-
</template>
|
|
193
|
-
|
|
194
|
-
<!-- 优先级2:default 插槽 - 完全自定义,不应用 popover -->
|
|
195
|
-
<slot v-else-if="row[prop] || !$slots.empty" :row="row.row" :column="props">
|
|
196
|
-
<!-- 优先级3:默认渲染 -->
|
|
183
|
+
<slot v-if="row[prop] || !$slots.empty">
|
|
197
184
|
<sub-table :rows="row[prop]" v-if="rowSpan" :border="cmpBorder" />
|
|
198
185
|
<view class="cell-box" v-else>
|
|
199
|
-
<template v-if="!
|
|
186
|
+
<template v-if="!parentProps.isPopover">
|
|
200
187
|
{{ cellText() }}
|
|
201
188
|
</template>
|
|
202
|
-
<table-popover v-else :text="cellText()" :line="
|
|
189
|
+
<table-popover v-else :text="cellText()" :line="parentProps.popoverLine"></table-popover>
|
|
203
190
|
</view>
|
|
204
191
|
</slot>
|
|
205
|
-
|
|
206
|
-
<!-- 空状态 -->
|
|
207
192
|
<view class="cell-box" v-else>
|
|
208
193
|
<slot name="empty"><text>暂无数据</text></slot>
|
|
209
194
|
</view>
|
|
@@ -125,16 +125,14 @@ const doHide = () => {
|
|
|
125
125
|
<template>
|
|
126
126
|
<view class="wrapper">
|
|
127
127
|
<view class="ellipsis-box" @touchstart="handleTouchStart" @touchend="handleTouchEnd" @mousedown="handleTouchStart">
|
|
128
|
-
|
|
128
|
+
{{ text }}
|
|
129
129
|
</view>
|
|
130
130
|
<!-- 不做展示,正常显示文字长度,用于判断是否超过长度 -->
|
|
131
|
-
<text class="measure-text">
|
|
132
|
-
<slot>{{ text }}</slot>
|
|
133
|
-
</text>
|
|
131
|
+
<text class="measure-text">{{ text }}</text>
|
|
134
132
|
|
|
135
133
|
<view class="popover" :class="showPopover ? 'show' : 'hidden'" :style="{ left: popoverLeft + 'px', top: popoverTop + 'px' }" :animation="animationData">
|
|
136
134
|
<view class="popover-content">
|
|
137
|
-
|
|
135
|
+
{{ text }}
|
|
138
136
|
</view>
|
|
139
137
|
<view class="popover-arrow" :style="{ left: arrowLeft + '%' }"></view>
|
|
140
138
|
</view>
|