mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Refactor #3965 - For DataViewLayoutOptions
This commit is contained in:
parent
088d0aaa35
commit
80478bbfe1
3 changed files with 45 additions and 14 deletions
|
@ -0,0 +1,35 @@
|
|||
<script>
|
||||
import BaseComponent from 'primevue/basecomponent';
|
||||
|
||||
const classes = {
|
||||
root: 'p-dataview-layout-options p-selectbutton p-buttonset',
|
||||
listButton: ({ props }) => [
|
||||
'p-button p-button-icon-only',
|
||||
{
|
||||
'p-highlight': props.modelValue === 'list'
|
||||
}
|
||||
],
|
||||
gridButton: ({ props }) => [
|
||||
'p-button p-button-icon-only',
|
||||
{
|
||||
'p-highlight': props.modelValue === 'grid'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'BaseDataViewLayoutOptions',
|
||||
extends: BaseComponent,
|
||||
props: {
|
||||
modelValue: String
|
||||
},
|
||||
css: {
|
||||
classes
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
$parentInstance: this
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue