from.vue 859 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <div>
  3. <van-form class="pragraph">
  4. <van-cell-group inset>
  5. <div
  6. class="text"
  7. v-text="item.title"
  8. :style="item.title_style"
  9. @click.stop="select"
  10. ></div>
  11. <slot></slot>
  12. </van-cell-group>
  13. </van-form>
  14. <br />
  15. </div>
  16. </template>
  17. <script setup>
  18. import { defineProps,inject } from 'vue';
  19. import 'vant/lib/index.css';
  20. const starEditorFormwork = inject('starEditorFormwork');
  21. const props = defineProps({
  22. item: Object,
  23. index: String
  24. });
  25. const select= () => {
  26. const newItem = JSON.parse(JSON.stringify(props.item || {}));
  27. newItem.leftEle = true;
  28. newItem.nodetail = true;
  29. starEditorFormwork(newItem, props.index);
  30. }
  31. </script>
  32. <style scoped>
  33. .pragraph {
  34. font-weight: 400;
  35. }
  36. .text {
  37. outline: none;
  38. border: 1px solid #fff;
  39. cursor: pointer;
  40. }
  41. </style>