Use refs instead of querySelector.

This commit is contained in:
Fatih Acet 2018-06-26 17:10:18 +02:00
parent 13a8ad61b2
commit c622252bd8
No known key found for this signature in database
GPG key ID: E994FE39E29B7E11

View file

@ -44,7 +44,6 @@ export default {
},
mounted() {
if (this.isLoggedIn) {
const textarea = this.$el.querySelector('.js-note-text');
const noteableData = this.getNoteableData;
const keys = [
NOTE_TYPE,
@ -56,7 +55,7 @@ export default {
this.line.lineCode,
];
this.autosave = new Autosave($(textarea), keys);
this.autosave = new Autosave($(this.$refs.noteForm.$refs.textarea), keys);
}
},
methods: {
@ -103,6 +102,7 @@ export default {
class="content discussion-form discussion-form-container discussion-notes"
>
<note-form
ref="noteForm"
:is-editing="true"
:line-code="line.lineCode"
save-button-title="Comment"