Passing computed value as a model prop fixed

pull/3463/head
Bahadır Sofuoğlu 2022-12-30 14:46:09 +03:00
parent c5c1e69a65
commit 5888f1d9e9
1 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div :id="id" class="p-panelmenu p-component"> <div :id="id" class="p-panelmenu p-component">
<template v-for="(item, index) of model" :key="getPanelKey(index)"> <template v-for="(item, index) of items" :key="getPanelKey(index)">
<div v-if="isItemVisible(item)" :style="getItemProp(item, 'style')" :class="getPanelClass(item)"> <div v-if="isItemVisible(item)" :style="getItemProp(item, 'style')" :class="getPanelClass(item)">
<div <div
:id="getHeaderId(index)" :id="getHeaderId(index)"
@ -70,9 +70,18 @@ export default {
}, },
data() { data() {
return { return {
activeItem: null activeItem: null,
items: null
}; };
}, },
watch: {
model: {
immediate: true,
handler(newValue) {
this.items = reactive(newValue);
}
}
},
methods: { methods: {
getItemProp(item, name) { getItemProp(item, name) {
return item ? ObjectUtils.getItemValue(item[name]) : undefined; return item ? ObjectUtils.getItemValue(item[name]) : undefined;