我find()
在将方法传递给子组件作为道具的方法中使用带箭头功能。该方法仅工作一次。我收到Invalid Prop
警告。第二次不再执行该方法。
vue.esm.js:628 [Vue warn]: Invalid prop: type check failed for prop "selectFkt". Expected Function, got Object
found in
---> <CompareView> at src/components/customComponents/compareView.vue
<ElementConfigurator> at src/components/customInputs/ownAwesomeInputs/elementConfigurator.vue
<Baustoffassistent> at src/components/SmartBrick/Baustoffassistent.vue
<VApp>
<App> at src/App.vue
<Root>
selectArticle(article) {
this.selectArticle = article;
var elementID = this.selectedelement.id;
this.selectArticle.elementID = elementID;
var element = this.elements.find(el => el.id === elementID);
element.artSelected = true;
}
有人对此问题有解决方案吗?任何帮助都会很高兴。
问题是线
this.selectArticle = article;
您正在用一个对象替换component方法。也许您想将文章分配给this.selectedArticle
?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句