Script setup中使用props和emit
Script setup语法糖中使用props和emit方法
import {defineEmits, defineProps, toRefs} from "vue" const props = defineProps({ route:{ type:String, default(){ return "" } }, title:{ type:String, default(){ return "" } } }) const {route, title} = toRefs(props) const emit = defineEmits(['change', 'delete'])