关于vue中对象的props默认值的问题
apiConfig: { //配置 type: Object, default () { return { type: "11", url: "11", urlParams: {}, labelName: "11", valueName: "11" } } },
如果以以上写法为对象设置默认值,会在父组件传入apiconfig对象时被覆盖,默认值无效?亲测如此
如需自定制要利用watch或者computed?
你看三小欸还不学习
apiConfig: { //配置 type: Object, default () { return { type: "11", url: "11", urlParams: {}, labelName: "11", valueName: "11" } } },
如果以以上写法为对象设置默认值,会在父组件传入apiconfig对象时被覆盖,默认值无效?亲测如此
如需自定制要利用watch或者computed?