<script lang="ts">
export default {
  data() {
    return {
      id: '',
    }
  },
  onLoad(payload: any) {
    const that=this
    that.id = payload.id
  },
}
</script>
 
<script lang="ts" setup>
import { reactive, onMounted, ref, onBeforeMount, getCurrentInstance } from 'vue'
let data = reactive<any>({
  id: '',
})
onBeforeMount(() => {
  data.id = (getCurrentInstance() as any).data.id
})
onMounted(() => {
  // console.log(data.id)
})
</script>

Logo

前往低代码交流专区

更多推荐