Skip to content

Commit

Permalink
Merge pull request #738 from tighten/fix-vue-2
Browse files Browse the repository at this point in the history
Fix Vue plugin on Vue 2
  • Loading branch information
bakerkretzmar authored Mar 26, 2024
2 parents 48f137e + 2ec69e2 commit bc56cb7
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 bc56cb7

Please sign in to comment.