<template>
  <a-week-picker v-bind="{ ...$attrs, value: momentValue }" @change="onChange"></a-week-picker>
</template>

<script>
import moment from 'moment'
import components from './_import-components/xm-week-picker-render-import'

export default {
  name: 'XmWeekPickerRender',
  components,
  data() {
    return {}
  },
  computed: {
    momentValue() {
      return this.$attrs.value ? moment(this.$attrs.value, 'YYYY-ww周') : null
    },
  },
  methods: {
    onChange(value, str) {
      this.$emit('input', str)
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
</style>
