Skip to content

Commit

Permalink
Only use globalProperties in Vue 3 and restore mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkretzmar committed Mar 26, 2024
1 parent 48f137e commit 2ec69e2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ export const ZiggyVue = {
const r = (name, params, absolute, config = options) =>
route(name, params, absolute, config);

app.config.globalProperties.route = r;

if (parseInt(app.version) > 2) {
app.config.globalProperties.route = r;
app.provide('route', r);
} else {
app.mixin({
methods: {
route: r,
},
});
}
},
};
Expand Down

0 comments on commit 2ec69e2

Please sign in to comment.