Modified3 months ago. I'm currently trying out some of the latest vue version and features (3.2). I've created a useFetch composable to reuse some logic (it's based on the vue documentation).
I'm using the useFetch composable in a component to fetch companies from the backend. The data I'm getting back is rough so I want to reformat it using a computed (That was the way I did it when using vue 2). When using Companies inside the template tags it stays null. I've checked and data has a companies property of the type Array with data in it. Anyone an idea how to handle this? 133133 bronze badges. 1,48311 gold badge1515 silver badges3535 bronze badges. 1515 silver badges3535 bronze badges. I think the issue may be due to use of ref.
Try using reactive for data instead of ref. To use ref, you would need to access the value via ref.value. Also, ref is not the best choice for objects and arrays as it was meant for primitive data types. to use ref you can.
Without further discussion, let’s see what’s new in Vue.js 3.2. Web Components-.
- Vue.js 3.2 came with a feature defineCustomElement strategy to effectively make native custom components using Vue components APIs. With this API developers can make Vue-controlled UI component libraries that can be used with any system, or no structure in nay any way, that is important when components are needed to be integrated in various innovation stacks.
- Also, the team added another part in the documentation on consuming and making Web Components in Vue. It acknowledges similar contentions as defineComponent, but returns a custom component constructor that broadens HTMLElement. Also, it works with Vue’s single-file components (SFC). However this use case needs some extra consideration with style tags.
Vue.js 3.2 features two new components for Single File Components (SFCs, aka. Vue files) that upgraded from experimental status to stable stage. While