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

學無先后,達者為師

網站首頁 編程語言 正文

:prop父組件給子組件傳遞函數 子組件接收 并default子組件自己的方法 問題

作者:接著奏樂接著舞 更新時間: 2023-08-15 編程語言

default: 中取不到this

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

判斷子組件是否接到父組件的方法 接到使用 沒有接到進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

  • 上一篇:沒有了
  • 下一篇:沒有了
欄目分類
最近更新