noticebar.uvue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <cl-page>
  3. <view class="p-3">
  4. <demo-item :label="t('基础用法')">
  5. <cl-noticebar
  6. text="云想衣裳花想容,春风拂槛露华浓。若非群玉山头见,会向瑶台月下逢。"
  7. ></cl-noticebar>
  8. </demo-item>
  9. <demo-item :label="t('带图标')">
  10. <view class="flex flex-row items-center">
  11. <cl-icon name="notification-4-line" class="mr-2"></cl-icon>
  12. <cl-noticebar
  13. text="云想衣裳花想容,春风拂槛露华浓。若非群玉山头见,会向瑶台月下逢。"
  14. ></cl-noticebar>
  15. </view>
  16. </demo-item>
  17. <demo-item :label="t('设置速度')">
  18. <cl-noticebar
  19. :speed="40"
  20. text="云想衣裳花想容,春风拂槛露华浓。若非群玉山头见,会向瑶台月下逢。"
  21. ></cl-noticebar>
  22. </demo-item>
  23. <demo-item :label="t('垂直方向')">
  24. <cl-noticebar
  25. direction="vertical"
  26. :text="[
  27. '江南可采莲,莲叶何田田',
  28. '鱼戏莲叶间',
  29. '鱼戏莲叶东',
  30. '鱼戏莲叶西',
  31. '鱼戏莲叶南',
  32. '鱼戏莲叶北'
  33. ]"
  34. ></cl-noticebar>
  35. </demo-item>
  36. </view>
  37. </cl-page>
  38. </template>
  39. <script lang="ts" setup>
  40. import { t } from "@/locale";
  41. import DemoItem from "../components/item.uvue";
  42. </script>