TabText.vue 674 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <el-tab-pane name="text">
  3. <template #label>
  4. <el-row align="middle"><Icon icon="ep:document" /> 文本</el-row>
  5. </template>
  6. <el-input type="textarea" :rows="5" placeholder="请输入内容" v-model="content" />
  7. </el-tab-pane>
  8. </template>
  9. <script setup lang="ts">
  10. const props = defineProps<{
  11. modelValue: string | null
  12. }>()
  13. const emit = defineEmits<{
  14. (e: 'update:modelValue', v: string | null)
  15. (e: 'input', v: string | null)
  16. }>()
  17. const content = computed<string | null>({
  18. get: () => props.modelValue,
  19. set: (val: string | null) => {
  20. emit('update:modelValue', val)
  21. emit('input', val)
  22. }
  23. })
  24. </script>
  25. <style scoped></style>