[Vuejs]-Error when using lodash in InertiaJS + Vue inside event handler

0👍

You need add it in mixin. try this way.

import _ from 'lodash';
window._ = _;

createApp({render: () => h(app, props)})
    .use(plugin)
    .mixin(require('@/Mixins/modules'))
    .mount(el)

.mixin(require(‘@/Mixins/modules’)) in app.js file and in Mixins/modules this code

module.exports = {
methods: {
    _: () => _,
    route,
  },
};

some way uses Ziggy route

Leave a comment