日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

:prop父組件給子組件傳遞函數(shù) 子組件接收 并default子組件自己的方法 問(wèn)題

作者:接著奏樂(lè)接著舞 更新時(shí)間: 2023-08-15 編程語(yǔ)言

default: 中取不到this

props:{
    beforeClose: {
      type: Function,
      default: null,
    },
}

判斷子組件是否接到父組件的方法 接到使用 沒(méi)有接到進(jìn)else自定義方法

beforeClose1() {
  console.log(this.beforeClose);
  console.log(5555);
  if (this.beforeClose) {
    return this.beforeClose();
  } else {
  }
},
:before-close="beforeClose1"

原文鏈接:https://blog.csdn.net/a378113472/article/details/123942950

  • 上一篇:沒(méi)有了
  • 下一篇:沒(méi)有了
欄目分類
最近更新