🌀(component): tag-input 样式, tag-width 超出 input 宽度时自动省略文本
This commit is contained in:
@@ -55,7 +55,7 @@ const classTag = computed(() => [
|
||||
|
||||
const styleTag = computed(() => [
|
||||
{
|
||||
"max-width": props.maxWidth ?? "unset",
|
||||
"max-width": props.maxWidth ?? "100%",
|
||||
...useTagCustomStyle(props).value,
|
||||
},
|
||||
]);
|
||||
@@ -105,10 +105,12 @@ function useTagCustomStyle(props: TagProps) {
|
||||
<span v-if="$slots.icon" class="layui-tag-icon">
|
||||
<slot name="icon" />
|
||||
</span>
|
||||
<span v-if="maxWidth" :style="styleTag" class="layui-tag-text">
|
||||
<slot />
|
||||
<span style="overflow: hidden;text-overflow: ellipsis;white-space:nowrap;">
|
||||
<span v-if="maxWidth" :style="styleTag" class="layui-tag-text">
|
||||
<slot />
|
||||
</span>
|
||||
<slot v-else />
|
||||
</span>
|
||||
<slot v-else />
|
||||
<span
|
||||
v-if="closable"
|
||||
class="layui-tag-close-icon"
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
width: fit-content;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user