.vue 文件配置
<template>
<div ref="listref">
<Table />
</div>
</template>
<script lang="ts">
impoort { getCurrentInstance, reactive, ref } from 'vue'
import { useStore } from '/@/store/index';
import router from '/@/router';
exportdefault{
name:"",
components:{},
props:{},
setup(props,{emit}){
const { proxy } = getCurrentInstance() as any;
const store = useStore();
const state = reactive({});
const listref = ref()
const list = () => {
emit('name',a)
}
return {
listref ,
list,
...toRefs(state),
};
}
}
</sctipt>
<script setup lang="ts">
import { reactive, ref } from 'vue'
import Table from "./component/table.vue"
const emits = defineEmits(["update"]);
const props = defineProps({
});
const a = ref()
const b = reactive({
name: "",
age: [],
obj: {}
})
const list = () => {
emits('定义父组件调用名字',list)
}
</sctipt>
<style scoped lang="scss">
</style>
|