update: a couple more perfomance related updates

* check for selected value inside Node instead of the wrapping renderer
* instead of "parsing" elements just return the current store.elements object
* use map funct to find index

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-19 15:41:00 +01:00
parent 08b9afb502
commit f92c5462bf
7 changed files with 49 additions and 51 deletions
+6 -4
View File
@@ -130,9 +130,10 @@ invoke(async () => {
})
watch(
elements,
(val) => {
(val, oldVal) => {
nextTick(() => {
store.setElements(val)
const hasDiff = diff(val, oldVal)
if (hasDiff.length > 0) store.setElements(val)
})
},
{ flush: 'pre', deep: true },
@@ -140,9 +141,10 @@ watch(
watch(
() => store.elements,
(val) => {
(val, oldVal) => {
nextTick(() => {
elements.value = val
const hasDiff = diff(val, oldVal)
if (hasDiff.length > 0) elements.value = val
})
},
{ flush: 'pre', deep: true },