<template>
  <div>
    <van-form class="pragraph">
      <van-cell-group inset>
        <div
          class="text"
          v-text="item.title"
          :style="item.title_style"
          @click.stop="select"
        ></div>
        <slot></slot>
      </van-cell-group>
    </van-form>
    <br />
  </div>
</template>

<script setup>
import { defineProps,inject } from 'vue';
import 'vant/lib/index.css';
const starEditorFormwork = inject('starEditorFormwork');

const props = defineProps({
  item: Object,
  index: String
});

const select= () => {
  const newItem = JSON.parse(JSON.stringify(props.item || {}));
  newItem.leftEle = true;
  newItem.nodetail = true;
  starEditorFormwork(newItem, props.index);
}
</script>

<style scoped>
.pragraph {
  font-weight: 400;
}
.text {
  outline: none;
  border: 1px solid #fff;
  cursor: pointer;
}
</style>
