What is the correct way to set a class to prototype in Vue NuxtJS?
I have created a plugin
Here is my nuxt.config.js file:
plugins: [
{ src: "~/plugins/global.js" },
],
The global.js file contains:
import Vue from "vue";
import CustomStore from "devextreme/data/custom_store";
// Trying to set it in the prototype
Vue.use(CustomStore)
However, I encounter an error that says:
A class must be instantiated using the 'new'
Although I know this approach is incorrect, I cannot find any resources on how to properly initialize it. One attempt was:
Vue.use(new CustomStore());
This removes the error, but how do I call it?
My aim is to use something like this in my component:
this.dataSource = this.$CustomStore({ ///... settings...// })