<template>
  <uni-data-pickerview
    ref="pickerView"
    v-bind="$attrs"
    @change="handleChange"
    @datachange="handleDatachange"
    @nodeclick="handleNodeclick"
    @update:modelValue="handleUpdateModelValue"
  />
</template>

<script>
export default {
  name: 'DataPickerView',
  inheritAttrs: false,
  methods: {
    updateData(data) {
      if (this.$refs.pickerView && this.$refs.pickerView.updateData) {
        this.$refs.pickerView.updateData(data)
      }
    },
    handleChange(event) {
      this.$emit('change', event)
    },
    handleDatachange(event) {
      this.$emit('datachange', event)
    },
    handleNodeclick(event) {
      this.$emit('nodeclick', event)
    },
    handleUpdateModelValue(value) {
      this.$emit('update:modelValue', value)
    }
  }
}
</script>

