VideoToolBarItem.vue 547 B

12345678910111213141516171819202122232425
  1. <script setup lang="ts">
  2. import { defineProps } from "vue";
  3. import { VideoCamera } from "@element-plus/icons-vue";
  4. import { NormalToolbar } from "md-editor-v3";
  5. const props = defineProps<{
  6. insert?: Function;
  7. }>();
  8. const onClick = () => {
  9. console.log("video");
  10. // TODO
  11. // emitHandler('video');
  12. props.insert?.(() => ({
  13. targetValue: "hello video",
  14. }));
  15. };
  16. </script>
  17. <template>
  18. <NormalToolbar title="video" @onClick="onClick">
  19. <template #trigger>
  20. <VideoCamera width="18" />
  21. </template>
  22. </NormalToolbar>
  23. </template>