Passing computed value as a model prop fixed
parent
c5c1e69a65
commit
5888f1d9e9
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue