子組件給父組件傳值,父組件中的data打印不出來子組件中this.$confirm('是否繼續(xù)完善信息?', '提示', {
confirmButtonText: '確定',
cancelButtonText: '取消',
type: 'warning'}).then(() => { console.log('進(jìn)入then'); //這個(gè)可以出來
this.$emit('listenTochildEvent','子組件傳值');
}).catch(() => { this.$message({
type: 'success',
message: '可點(diǎn)擊“完善”繼續(xù)完善信息'
});
});父組件中//Vue<preparation-basic-detail-comp @listenTochildEvent="listenTochildEvent">
</preparation-basic-detail-comp>//JSlistenTochildEvent(data){
console.log(data); //出不來}
添加回答
舉報(bào)
0/150
提交
取消