How to use Vue.util.extend in Vue 3?

Viewed 1510

How does one use Vue.util.extend in a Vue Component?

I need to copy data (with no references) from a prop and using Vue.util.extend({}, this.propData) was suggested, but there's no instructions on how to use that.

What exactly do I have to import to get the helper function working?

example-component.vue

<script>
import Vue ...???

export default {

  props: {
    propData: Array
  }

  data() {
    return() {
      localPropData: Vue.util.extend({}, this.propData)
    }
  }
}
</script>

Even links to some form of documentation on this would be helpful. For now I decided to just use JSON.parse(JSON.stringify(this.propData)) which works perfectly fine.

Using Vue 3 via Laravel 8

0 Answers
Related