stop using vue.set

This commit is contained in:
Henry Jameson 2021-04-25 13:24:08 +03:00
parent fca885e665
commit 905b9771ec
11 changed files with 52 additions and 64 deletions

View file

@ -1,4 +1,3 @@
import { set } from 'vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faChevronDown
@ -40,8 +39,8 @@ export default {
return this.dValue.family
},
set (v) {
set(this.lValue, 'family', v)
this.$emit('input', this.lValue)
this.lValue.family = v
this.$emit('update:modelValue', this.lValue)
}
},
isCustom () {

View file

@ -34,7 +34,7 @@ const Gallery = {
},
methods: {
onNaturalSizeLoad (id, size) {
this.$set(this.sizes, id, size)
this.sizes[id] = size
},
rowStyle (itemsPerRow) {
return { 'padding-bottom': `${(100 / (itemsPerRow + 0.6))}%` }

View file

@ -1,4 +1,3 @@
import { set, delete as del } from 'vue'
import {
rgb2hex,
hex2rgb,
@ -326,9 +325,9 @@ export default {
},
set (val) {
if (val) {
set(this.shadowsLocal, this.shadowSelected, this.currentShadowFallback.map(_ => Object.assign({}, _)))
this.shadowsLocal[this.shadowSelected] = this.currentShadowFallback.map(_ => Object.assign({}, _))
} else {
del(this.shadowsLocal, this.shadowSelected)
delete this.shadowsLocal[this.shadowSelected]
}
}
},
@ -340,7 +339,7 @@ export default {
return this.shadowsLocal[this.shadowSelected]
},
set (v) {
set(this.shadowsLocal, this.shadowSelected, v)
this.shadowsLocal[this.shadowSelected] = v
}
},
themeValid () {
@ -562,7 +561,7 @@ export default {
.filter(_ => _.endsWith('ColorLocal') || _.endsWith('OpacityLocal'))
.filter(_ => !v1OnlyNames.includes(_))
.forEach(key => {
set(this.$data, key, undefined)
this.$data[key] = undefined
})
},
@ -570,7 +569,7 @@ export default {
Object.keys(this.$data)
.filter(_ => _.endsWith('RadiusLocal'))
.forEach(key => {
set(this.$data, key, undefined)
this.$data[key] = undefined
})
},
@ -578,7 +577,7 @@ export default {
Object.keys(this.$data)
.filter(_ => _.endsWith('OpacityLocal'))
.forEach(key => {
set(this.$data, key, undefined)
this.$data[key] = undefined
})
},