Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with Vue 3 #15

Open
JamesPoel opened this issue Nov 20, 2021 · 2 comments
Open

Not compatible with Vue 3 #15

JamesPoel opened this issue Nov 20, 2021 · 2 comments

Comments

@JamesPoel
Copy link

JamesPoel commented Nov 20, 2021

.use(VueDeepSet) fires the exception:

app.js:43224 Uncaught (in promise) TypeError: Cannot set properties of undefined (setting '$deepModel')

window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

import BootstrapVue3 from 'bootstrap-vue-3';

import {createApp, h} from 'vue';
import {createInertiaApp} from '@inertiajs/inertia-vue3';

import * as VueDeepSet from 'vue-deepset';

createInertiaApp({
    resolve: name => require(`./Pages/${name}`),
    setup({el, App, props, plugin}) {
        createApp({render: () => h(App, props)})
            .use(plugin)
            .use(BootstrapVue3)
            .use(VueDeepSet)
            .mount(el)
    },
});
@JamesPoel
Copy link
Author

JamesPoel commented Nov 20, 2021

Replacing:

export function install (VueInstance) {
    VueInstance.prototype.$deepModel = deepModel
    VueInstance.prototype.$vueSet = vueSet
    VueInstance.prototype.$vuexSet = vuexSet
}

with:

export function install (VueInstance) {
    VueInstance.config.globalProperties.$deepModel = deepModel;
    VueInstance.config.globalProperties.$vueSet =  vueSet;
    VueInstance.config.globalProperties.$vuexSet = vuexSet;
}

Seems to get the plugin semi-working with Vue3 (although probably isn't backwards-compatible with 1/2), however the plugin also uses Vue.set which is defunct as of Vue3.

@ReynerHL
Copy link

ReynerHL commented Nov 21, 2021

@JamesPoel Perhaps this is not the right place for asking something like this, but I'm curious.

Are you using vue-deepset for state management support (Vuex with esteroids) ?

In case this is true, If you are using Inertia, why are you needing and state management layer ?

Please, don't get me wrong, I just want to know because your proposal seems very interested to my.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants