vue inject computed bug All In One
vue inject computed bug All In One
shit code 💩
reactive inject ???inject
export default {
name: 'CustomFilter',
inject: {
parentCustomConfig: 'customConfig',
parentFilterData: 'filterData',
},
computed: {
customConfig () {
return this.parentCustomConfig();
},
filterData () {
return this.parentFilterData();
},
},
};
good code ✅
export default {
name: 'CustomFilter',
inject: [
'customConfig',
'filterData',
],
};
provide/inject
https://vuejs.org/v2/guide/components-edge-cases.html#Dependency-Injection
https://vuejs.org/v2/api/#provide-inject
refs
https://github.com/vuejs/vue/issues/7017
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/15667062.html
未经授权禁止转载,违者必究!