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'])

 

posted @ 2021-12-28 19:38  邢韬  阅读(1633)  评论(0编辑  收藏  举报