mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Fixed #3802 - Improve folder structure for nuxt configurations
This commit is contained in:
parent
851950270b
commit
f5fe822afb
563 changed files with 1703 additions and 1095 deletions
53
components/lib/dataviewlayoutoptions/DataViewLayoutOptions.vue
Executable file
53
components/lib/dataviewlayoutoptions/DataViewLayoutOptions.vue
Executable file
|
@ -0,0 +1,53 @@
|
|||
<template>
|
||||
<div class="p-dataview-layout-options p-selectbutton p-buttonset" role="group">
|
||||
<button :aria-label="listViewAriaLabel" :class="buttonListClass" @click="changeLayout('list')" type="button" :aria-pressed="isListButtonPressed">
|
||||
<i class="pi pi-bars"></i>
|
||||
</button>
|
||||
<button :aria-label="gridViewAriaLabel" :class="buttonGridClass" @click="changeLayout('grid')" type="button" :aria-pressed="isGridButtonPressed">
|
||||
<i class="pi pi-th-large"></i>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DataViewLayoutOptions',
|
||||
emits: ['update:modelValue'],
|
||||
props: {
|
||||
modelValue: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isListButtonPressed: false,
|
||||
isGridButtonPressed: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeLayout(layout) {
|
||||
this.$emit('update:modelValue', layout);
|
||||
|
||||
if (layout === 'list') {
|
||||
this.isListButtonPressed = true;
|
||||
this.isGridButtonPressed = false;
|
||||
} else if (layout === 'grid') {
|
||||
this.isGridButtonPressed = true;
|
||||
this.isListButtonPressed = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
buttonListClass() {
|
||||
return ['p-button p-button-icon-only', { 'p-highlight': this.modelValue === 'list' }];
|
||||
},
|
||||
buttonGridClass() {
|
||||
return ['p-button p-button-icon-only', { 'p-highlight': this.modelValue === 'grid' }];
|
||||
},
|
||||
listViewAriaLabel() {
|
||||
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.listView : undefined;
|
||||
},
|
||||
gridViewAriaLabel() {
|
||||
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.gridView : undefined;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue