神奇的props

  props: {
    deliver: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },

deliver {}

  props: {
    deliver: {
      type: Object,
      default: () => {},
    },
  },

deliver undefined

PS:昨天看了ES6写法,箭头函数还可以这么写
加小括号它就能识别出这玩意是对象OR空数组了!

  props: {
    deliver: {
      type: Object,
      default: () => ({})
    },
  },
posted @ 2021-12-15 17:52  乐盘游  阅读(22)  评论(0编辑  收藏  举报