index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div class="page-content">
  3. <!-- 基础用法 -->
  4. <ArtTextScroll
  5. text="逐趣CRM 是一款专注于用户体验和视觉设计的后台管理系统模版 <a target='_blank' href='https://www.lingchen.kim/art-design-pro/docs/'>点击我 </a>访问官方文档"
  6. showClose
  7. />
  8. <!-- 使用不同的类型 -->
  9. <ArtTextScroll type="success" text="这是一条成功类型的滚动公告" showClose />
  10. <ArtTextScroll type="warning" text="这是一条警告类型的滚动公告" showClose />
  11. <ArtTextScroll type="danger" text="这是一条危险类型的滚动公告" showClose />
  12. <ArtTextScroll type="info" text="这是一条信息类型的滚动公告" showClose />
  13. <!-- 可关闭 -->
  14. <ArtTextScroll text="这是一条可关闭的滚动公告" showClose @close="handleClose" />
  15. <!-- 使用打字机效果 -->
  16. <ArtTextScroll
  17. text="这是一条打字机效果的滚动公告,打字机速度为 200 毫秒"
  18. typewriter
  19. :typewriter-speed="200"
  20. />
  21. <!-- 自定义速度和方向 -->
  22. <ArtTextScroll text="这是一条速度较慢、向右滚动的公告" :speed="30" direction="right" />
  23. </div>
  24. </template>
  25. <script setup lang="ts">
  26. const handleClose = () => {
  27. console.log('关闭')
  28. }
  29. </script>
  30. <style lang="scss" scoped>
  31. .page-content {
  32. :deep(.text-scroll-container) {
  33. margin-bottom: 20px;
  34. }
  35. }
  36. </style>