-
Notifications
You must be signed in to change notification settings - Fork 825
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
[2.x] Upgrade VueJS to version 3 #666
Changes from 9 commits
0b91ea4
e5cf375
68217e7
2a7da64
babdcfe
ad2475b
1020b82
961ff59
d5dcabf
b8f764f
65d0d4c
b977197
89d2b43
e06cf8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,8 @@ | |
import Modal from './Modal' | ||
|
||
export default { | ||
emits: ['close'], | ||
|
||
components: { | ||
Modal, | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ | |
import Modal from './Modal' | ||
|
||
export default { | ||
emits: ['close'], | ||
|
||
components: { | ||
Modal, | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,10 +55,6 @@ | |
} | ||
} | ||
|
||
this.$once('hook:destroyed', () => { | ||
document.removeEventListener('keydown', closeOnEscape) | ||
}) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So where does this get removed now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops totally forgot about that, I will add it tommorow, this hook removed at first because the depreciation of |
||
document.addEventListener('keydown', closeOnEscape) | ||
}, | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,5 @@ | ||||||
<template> | ||||||
<portal to="modal"> | ||||||
<Teleport to="#modal"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't tested this, but do you really need the
Suggested change
|
||||||
<transition leave-active-class="duration-200"> | ||||||
<div v-show="show" class="fixed inset-0 overflow-y-auto px-4 py-6 sm:px-0 z-50"> | ||||||
<transition enter-active-class="ease-out duration-300" | ||||||
|
@@ -25,11 +25,13 @@ | |||||
</transition> | ||||||
</div> | ||||||
</transition> | ||||||
</portal> | ||||||
</Teleport> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</template> | ||||||
|
||||||
<script> | ||||||
export default { | ||||||
emits: ['close'], | ||||||
|
||||||
props: { | ||||||
show: { | ||||||
default: false | ||||||
|
@@ -71,10 +73,6 @@ | |||||
} | ||||||
|
||||||
document.addEventListener('keydown', closeOnEscape) | ||||||
|
||||||
this.$once('hook:destroyed', () => { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. However we solve this in the |
||||||
document.removeEventListener('keydown', closeOnEscape) | ||||||
}) | ||||||
}, | ||||||
|
||||||
computed: { | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,7 +30,7 @@ | |||||
<div class="mt-4" v-if="$page.props.jetstream.hasTermsAndPrivacyPolicyFeature"> | ||||||
<jet-label for="terms"> | ||||||
<div class="flex items-center"> | ||||||
<jet-checkbox name="terms" id="terms" v-model="form.terms" /> | ||||||
<jet-checkbox name="terms" id="terms" v-model:checked="form.terms"/> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing space.
Suggested change
|
||||||
|
||||||
<div class="ml-2"> | ||||||
I agree to the <a target="_blank" :href="route('terms.show')" class="underline text-sm text-gray-600 hover:text-gray-900">Terms of Service</a> and <a target="_blank" :href="route('policy.show')" class="underline text-sm text-gray-600 hover:text-gray-900">Privacy Policy</a> | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
require('./bootstrap'); | ||
|
||
// Import modules... | ||
import Vue from 'vue'; | ||
import { App as InertiaApp, plugin as InertiaPlugin } from '@inertiajs/inertia-vue'; | ||
import PortalVue from 'portal-vue'; | ||
import { createApp, h } from 'vue'; | ||
import { App as InertiaApp, plugin as InertiaPlugin } from '@inertiajs/inertia-vue3'; | ||
|
||
Vue.mixin({ methods: { route } }); | ||
Vue.use(InertiaPlugin); | ||
Vue.use(PortalVue); | ||
const el = document.getElementById('app'); | ||
|
||
const app = document.getElementById('app'); | ||
|
||
new Vue({ | ||
render: (h) => | ||
createApp({ | ||
render: () => | ||
h(InertiaApp, { | ||
props: { | ||
initialPage: JSON.parse(app.dataset.page), | ||
resolveComponent: (name) => require(`./Pages/${name}`).default, | ||
}, | ||
initialPage: JSON.parse(el.dataset.page), | ||
resolveComponent: (name) => require(`./Pages/${name}`).default, | ||
}), | ||
}).$mount(app); | ||
}) | ||
.mixin({ methods: { route } }) | ||
.use(InertiaPlugin) | ||
.mount(el); |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -19,5 +19,8 @@ | |||||||
</head> | ||||||||
<body class="font-sans antialiased"> | ||||||||
@inertia | ||||||||
|
||||||||
<!-- Modal Teleport --> | ||||||||
<div id="modal"></div> | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not required, as per comment above.
Suggested change
|
||||||||
</body> | ||||||||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth bumping this to
0.8.4
, given the recent axios vulnerability (see here).