view.vue 646 B

12345678910111213141516171819202122
  1. <template>
  2. <div class="basic-editor-view" :style="{...inputStyle, width }" v-textarea="html"></div>
  3. </template>
  4. <script>
  5. import { computed } from 'vue'
  6. import textareaDirectives from '@cip/components/directives/textarea'
  7. import { formInputViewProps, useFormView } from '@cip/components/helper/form-input'
  8. import './index.less'
  9. export default {
  10. props: formInputViewProps,
  11. directives: {
  12. [textareaDirectives.name]: textareaDirectives
  13. },
  14. setup (props) {
  15. const { width, inputStyle } = useFormView(props)
  16. const html = computed(() => props.modelValue)
  17. return { html, width, inputStyle }
  18. }
  19. }
  20. </script>