クリックしたときに編集したい要素のリストがあります。 私は他のコンポーネントに似たようなソリューションを持っていますが、それは完全にうまくいっていますが、新しいものではそれができず、理由を見つけることができません。VueJS - イベント "click"の無効なハンドラ:未定義です
コンポーネントは、私が得たレンダリングされた場合: Invalid handler for event "click": got undefined
一覧:
<div v-for="annt in anns" class="item two-lines" v-if="!anntInEdit">
<div class="item-content has-secondary" v-on:click="edit(annt)">
<div>
{{ annt.title }}
</div>
<div >
{{ annt.body}}
</div>
</div>
<div class="item-secondary">
<a><i >delete</i></a>
</div>
</div>
JS:
edit (annt) {
if (this.anntInEdit == null) {
this.anntInEdit = annt
this.anntInEditBackup = Object.assign({}, this.anntInEdit)
}
this.anntInEditIndex = this.anns.indexOf(annt)
},
私はクリックするだけだろう、私が得た形で編集SNFのdiv要素で発表私はsave(ajax)を使うことができます。キャンセル(nullに設定してください)などですが、編集div内の入力に触れるとすぐに [Vue warn]: Invalid handler for event "click": got undefined
vue.common.js?e881:1559 Uncaught (in promise) TypeError: Cannot read property 'invoker' of undefined
エラーが発生すると、版のボタンはまったく機能しません。
新しい/編集に同じdivが使用され、新しい通知のために完全に正常に動作しています。 アイデア
コンポーネント全体のペーストビン:http://pastebin.com/JvkGdW6H
全体のコンポーネント構造。 –
私はこの晩、私は自宅でコードを持っています –
全体のコンポーネント:http://pastebin.com/JvkGdW6H –