refactor: #7090 for Accordion
parent
2f8e0ccda1
commit
e8105b8971
|
@ -28,7 +28,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { UniqueComponentId } from '@primevue/core/utils';
|
|
||||||
import ChevronRightIcon from '@primevue/icons/chevronright';
|
import ChevronRightIcon from '@primevue/icons/chevronright';
|
||||||
import ChevronUpIcon from '@primevue/icons/chevronup';
|
import ChevronUpIcon from '@primevue/icons/chevronup';
|
||||||
import AccordionContent from 'primevue/accordioncontent';
|
import AccordionContent from 'primevue/accordioncontent';
|
||||||
|
@ -44,14 +43,10 @@ export default {
|
||||||
emits: ['update:value', 'update:activeIndex', 'tab-open', 'tab-close', 'tab-click'],
|
emits: ['update:value', 'update:activeIndex', 'tab-open', 'tab-close', 'tab-click'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
id: this.$attrs.id,
|
|
||||||
d_value: this.value
|
d_value: this.value
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$attrs.id': function (newValue) {
|
|
||||||
this.id = newValue || UniqueComponentId();
|
|
||||||
},
|
|
||||||
value(newValue) {
|
value(newValue) {
|
||||||
this.d_value = newValue;
|
this.d_value = newValue;
|
||||||
},
|
},
|
||||||
|
@ -64,9 +59,6 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.id = this.id || UniqueComponentId();
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
isItemActive(value) {
|
isItemActive(value) {
|
||||||
return this.multiple ? this.d_value?.includes(value) : this.d_value === value;
|
return this.multiple ? this.d_value?.includes(value) : this.d_value === value;
|
||||||
|
|
Loading…
Reference in New Issue