fs-date-format.vue 361 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <view>
  3. {{dateFormat}}
  4. </view>
  5. </template>
  6. <script setup>
  7. import 'dayjs'
  8. const props = defineProps({
  9. date: String,
  10. format: {
  11. type: String,
  12. default: 'YYYY-MM-DD'
  13. }
  14. })
  15. const emits = defineEmits(['click'])
  16. const dateFormat = dayjs(props.date).format(props.format)
  17. const handleClick = () => {
  18. emits('click')
  19. }
  20. </script>
  21. <style>
  22. </style>