Files
admin-vben5/apps/web-antd/src/views/examples/ellipsis/index.vue
invalid w f1e0278bd8 chore: define examples router & add ellipsis comp (#4019)
* chore: define components router

* chore: 组件路由放置到演示路由下

* Revert "chore: 组件路由放置到演示路由下"

This reverts commit 3c24632ad51f031cf95aafa49183d7c5538098bb.

* chore: typo

* chore: 增加密码强度组件

* chore: 国际化密码强度的菜单

* chore(@vben/web-antd): 迁移文本省略组件

* chore: typo

* chore: 组件命名方式遵从packages

* chore: Optimize the onExpand function

* chore: update css

* chore(@vben/web-antd): optimize the getPosition function

* chore: add ellipsis-text in comm-ui

* chore: 文本省略组件迁移至common-ui

* feat(@vben/common-ui): Tooltip的tip支持style传参

* chore: 优化组件渲染

* chore: 使用css module解决样式冲突

* chore: update props

* chore: 优化css

* chore: rm unuse attr

---------

Co-authored-by: Li Kui <90845831+likui628@users.noreply.github.com>
2024-08-09 10:57:46 +08:00

43 lines
1.5 KiB
Vue

<script lang="ts" setup>
import { ref } from 'vue';
import { EllipsisText } from '@vben/common-ui';
import { Collapse, CollapsePanel } from 'ant-design-vue';
import { longText } from './data';
const text = ref(longText);
const activeKey = ref(['1', '2', '3', '4']);
</script>
<template>
<div class="card-box p-5">
<h1 class="mb-5 text-xl font-semibold">文本省略示例</h1>
<div>
<Collapse v-model:activeKey="activeKey">
<CollapsePanel key="1" header="Ellipsis 基本使用">
<EllipsisText :max-width="240">{{ text }}</EllipsisText>
</CollapsePanel>
<CollapsePanel key="2" header="Ellipsis 多行省略">
<EllipsisText :line="2">{{ text }}</EllipsisText>
</CollapsePanel>
<CollapsePanel key="3" header="Ellipsis 点击展开">
<EllipsisText :line="3" expand>{{ text }}</EllipsisText>
</CollapsePanel>
<CollapsePanel key="4" header="Ellipsis 定制 Tooltip 内容">
<EllipsisText :max-width="240">
住在我心里孤独的 孤独的海怪 痛苦之王 开始厌倦 深海的光 停滞的海浪
<template #tooltip>
<div style="text-align: center">
秦皇岛<br />住在我心里孤独的<br />孤独的海怪 痛苦之王<br />开始厌倦
深海的光 停滞的海浪
</div>
</template>
</EllipsisText>
</CollapsePanel>
</Collapse>
</div>
</div>
</template>