Refactor #3965 - For Textarea

This commit is contained in:
Tuğçe Küçükoğlu 2023-05-24 17:15:21 +03:00
parent ce6a30fb26
commit ee99bbb7c4
3 changed files with 55 additions and 18 deletions

View 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>