Remove $set and $delete

This commit is contained in:
Kasper Seweryn 2022-05-02 10:57:33 +02:00 committed by Georg Krause
parent 7a823282f9
commit 8ff0bb937b
6 changed files with 8 additions and 22 deletions

View File

@ -118,8 +118,8 @@
{{ $store.state.ui.notifications.inbox + additionalNotifications }} {{ $store.state.ui.notifications.inbox + additionalNotifications }}
</div> </div>
<user-menu <user-menu
:width="width"
v-bind="$attrs" v-bind="$attrs"
:width="width"
/> />
</div> </div>
</div> </div>

View File

@ -126,18 +126,16 @@
<textarea <textarea
v-if="field.input_type === 'long_text'" v-if="field.input_type === 'long_text'"
:id="`custom-field-${idx}`" :id="`custom-field-${idx}`"
:value="customFields[field.label]" v-model="customFields[field.label]"
:required="field.required || null" :required="field.required || null"
rows="5" rows="5"
@input="$set(customFields, field.label, $event.target.value)"
/> />
<input <input
v-else v-else
:id="`custom-field-${idx}`" :id="`custom-field-${idx}`"
v-model="customFields[field.label]"
type="text" type="text"
:value="customFields[field.label]"
:required="field.required || null" :required="field.required || null"
@input="$set(customFields, field.label, $event.target.value)"
> >
</div> </div>
</template> </template>

View File

@ -242,10 +242,10 @@ export default {
} }
axios.get(config.url, { params: { id: uniq(config.ids), hidden: 'null' } }).then((response) => { axios.get(config.url, { params: { id: uniq(config.ids), hidden: 'null' } }).then((response) => {
response.data.results.forEach((e) => { response.data.results.forEach((e) => {
self.$set(self.targets[k], e.id, { self.targets[k][e.id] = {
payload: e, payload: e,
currentState: edits.getCurrentStateForObj(e, edits.getConfigs.bind(self)()[k]) currentState: edits.getCurrentStateForObj(e, edits.getConfigs.bind(self)()[k])
}) }
}) })
}, error => { }, error => {
self.errors = error.backendErrors self.errors = error.backendErrors

View File

@ -50,9 +50,6 @@ Promise.all(modules).finally(() => {
}) })
// TODO (wvffle): Migrate to pinia // TODO (wvffle): Migrate to pinia
// TODO (wvffle): Remove global Vue (Only vuex files affected)
// TODO (wvffle): Remove shims-vue2.d.ts
// TODO (wvffle): Replace $set and $delete with reactive()
// TODO (wvffle): Check for mixin merging: https://v3-migration.vuejs.org/breaking-changes/data-option.html#mixin-merge-behavior-change= // TODO (wvffle): Check for mixin merging: https://v3-migration.vuejs.org/breaking-changes/data-option.html#mixin-merge-behavior-change=
// TODO (wvffle): Use emits options: https://v3-migration.vuejs.org/breaking-changes/emits-option.html // TODO (wvffle): Use emits options: https://v3-migration.vuejs.org/breaking-changes/emits-option.html
// TODO (wvffle): Find all array watchers and make them deep // TODO (wvffle): Find all array watchers and make them deep

View File

@ -1,8 +0,0 @@
declare module 'vue' {
import { CompatVue } from '@vue/runtime-dom'
const Vue: CompatVue
export default Vue
export * from '@vue/runtime-dom'
const { configureCompat } = Vue
export { configureCompat }
}

View File

@ -1,4 +1,3 @@
import Vue from 'vue'
import axios from 'axios' import axios from 'axios'
import useLogger from '~/composables/useLogger' import useLogger from '~/composables/useLogger'
@ -12,8 +11,8 @@ function getDefaultScopedTokens () {
function asForm (obj) { function asForm (obj) {
const data = new FormData() const data = new FormData()
Object.entries(obj).forEach((e) => { Object.entries(obj).forEach(([key, value]) => {
data.set(e[0], e[1]) data.set(key, value)
}) })
return data return data
} }
@ -112,7 +111,7 @@ export default {
}, },
profilePartialUpdate: (state, payload) => { profilePartialUpdate: (state, payload) => {
Object.keys(payload).forEach((k) => { Object.keys(payload).forEach((k) => {
Vue.set(state.profile, k, payload[k]) state.profile[k] = payload[k]
}) })
}, },
oauthApp: (state, payload) => { oauthApp: (state, payload) => {