mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3965 - For Toolbar
This commit is contained in:
parent
3ce238b07f
commit
a21c83e927
3 changed files with 69 additions and 34 deletions
57
components/lib/toolbar/BaseToolbar.vue
Normal file
57
components/lib/toolbar/BaseToolbar.vue
Normal file
|
@ -0,0 +1,57 @@
|
|||
<script>
|
||||
import BaseComponent from 'primevue/basecomponent';
|
||||
import { useStyle } from 'primevue/usestyle';
|
||||
|
||||
const styles = `
|
||||
.p-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.p-toolbar-group-start,
|
||||
.p-toolbar-group-center,
|
||||
.p-toolbar-group-end {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.p-toolbar-group-left,
|
||||
.p-toolbar-group-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
`;
|
||||
|
||||
const classes = {
|
||||
root: 'p-toolbar p-component',
|
||||
start: 'p-toolbar-group-start p-toolbar-group-left',
|
||||
center: 'p-toolbar-group-center',
|
||||
end: 'p-toolbar-group-end p-toolbar-group-right'
|
||||
};
|
||||
|
||||
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_toolbar_style', manual: true });
|
||||
|
||||
export default {
|
||||
name: 'BaseToolbar',
|
||||
extends: BaseComponent,
|
||||
props: {
|
||||
'aria-labelledby': {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
css: {
|
||||
classes
|
||||
},
|
||||
watch: {
|
||||
isUnstyled: {
|
||||
immediate: true,
|
||||
handler(newValue) {
|
||||
!newValue && loadStyle();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue