title.vue 731 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <el-form-item label="内容:">
  3. <el-input
  4. @focus="$emit('inputIng', true)"
  5. @blur="$emit('inputIng', false)"
  6. :maxlength="500"
  7. style="width: 220px"
  8. v-model="value"
  9. @change="shape.setText(value)"
  10. >
  11. <template #append>
  12. <el-button type="primary" @click="$emit('blur')">确定</el-button>
  13. </template>
  14. </el-input>
  15. </el-form-item>
  16. </template>
  17. <script setup lang="ts">
  18. import { ref } from "vue";
  19. import { BoardShape } from "../board";
  20. const props = defineProps<{ shape: BoardShape }>();
  21. const emit = defineEmits<{
  22. (e: "delete"): void;
  23. (e: "blur"): void;
  24. (e: "inputIng", ing: boolean): void;
  25. }>();
  26. const value = ref(props.shape.data.text);
  27. </script>