MES手机端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

52 lines
1.3 KiB

  1. <script lang="ts" setup>
  2. import { computed, inject } from 'vue'
  3. import TnIcon from '@tuniao/tnui-vue3-uniapp/components/icon/src/icon.vue'
  4. import { timeLineKey } from './tokens'
  5. import { timeLineDataEmits, timeLineDataProps } from './time-line-data'
  6. import { useTimeLineDataCustomStyle } from './composables'
  7. const props = defineProps(timeLineDataProps)
  8. const emits = defineEmits(timeLineDataEmits)
  9. const timeLineContext = inject(timeLineKey, undefined)
  10. const showLine = computed<boolean>(() =>
  11. timeLineContext?.showLine.value === undefined
  12. ? true
  13. : timeLineContext?.showLine.value
  14. )
  15. const { ns, dotClass, dotStyle } = useTimeLineDataCustomStyle(props)
  16. // 点击事件
  17. const clickHandle = () => {
  18. emits('click')
  19. }
  20. </script>
  21. // #ifdef MP-WEIXIN
  22. <script lang="ts">
  23. export default {
  24. options: {
  25. // 在微信小程序中将组件节点渲染为虚拟节点,更加接近Vue组件的表现(不会出现shadow节点下再去创建元素)
  26. virtualHost: true,
  27. },
  28. }
  29. </script>
  30. // #endif
  31. <template>
  32. <view :class="[ns.b(), ns.is('line', showLine)]" @tap.stop="clickHandle">
  33. <view :class="[ns.e('dot'), dotClass]" :style="dotStyle">
  34. <TnIcon name="circle-fill" />
  35. </view>
  36. <view :class="[ns.e('content')]">
  37. <slot />
  38. </view>
  39. </view>
  40. </template>
  41. <style lang="scss">
  42. @import './theme-chalk/time-line-data.scss';
  43. </style>