view.js 446 B

123456789101112
  1. import { h, computed, withDirectives } from 'vue'
  2. import { formInputViewProps } from '../../form-input-props'
  3. import textareaDirectives from '../../../directives/textarea'
  4. export default {
  5. props: formInputViewProps,
  6. setup (props) {
  7. const width = computed(() => {
  8. return props.config?.width ?? '100%'
  9. })
  10. return () => withDirectives(h('div', { style: { width: width.value } }), [[textareaDirectives, props.modelValue]])
  11. }
  12. }