import { ref } from 'vue'

export function messageToggle() { const msgType = ref('') const messageText = ref('') const messageRef = ref(null)

const openMessage = (type) => { msgType.value = type messageText.value = 这是一条${type}消息提示 messageRef.value.open() }

return { msgType, messageText, messageRef, openMessage } }

messageToggletype 				thismsgType = type				thismessageText = 这是一条$type消息提示				this$refsmessageopen			转成vue3组合式

原文地址: https://www.cveoy.top/t/topic/dyfW 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录