mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3965 - For Textarea
This commit is contained in:
parent
ce6a30fb26
commit
ee99bbb7c4
3 changed files with 55 additions and 18 deletions
47
components/lib/textarea/BaseTextarea.vue
Normal file
47
components/lib/textarea/BaseTextarea.vue
Normal file
|
@ -0,0 +1,47 @@
|
|||
<script>
|
||||
import BaseComponent from 'primevue/basecomponent';
|
||||
import { useStyle } from 'primevue/usestyle';
|
||||
|
||||
const styles = `
|
||||
.p-inputtextarea-resizable {
|
||||
overflow: hidden;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.p-fluid .p-inputtextarea {
|
||||
width: 100%;
|
||||
}
|
||||
`;
|
||||
|
||||
const classes = {
|
||||
root: ({ instance, props }) => [
|
||||
'p-inputtextarea p-inputtext p-component',
|
||||
{
|
||||
'p-filled': instance.filled,
|
||||
'p-inputtextarea-resizable ': props.autoResize
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_textarea_style', manual: true });
|
||||
|
||||
export default {
|
||||
name: 'BaseTextarea',
|
||||
extends: BaseComponent,
|
||||
props: {
|
||||
modelValue: null,
|
||||
autoResize: Boolean
|
||||
},
|
||||
css: {
|
||||
classes
|
||||
},
|
||||
watch: {
|
||||
isUnstyled: {
|
||||
immediate: true,
|
||||
handler(newValue) {
|
||||
!newValue && loadStyle();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue