[Vuejs]-Jquery hide() works ramdonly

0👍

Why do you want to use jquery for this? Vue has it’s own (and better :-P) way of dealing with this.

Vue’s Philosophy (As well as angular’s and reac’s etc) is no touch the DOM directly as rarely as possible, and instad let the libarary change the DOM to fit the state/Data of a component.

html:

<textarea v-show="showEditBox" class="edit-box"><textarea>

JS

data: function () {
  return { showEditBox: true }
},
methods: {
  moveUpLib: function () {
    //other stuff...
    this.showEditBox = false // <= hides the textarea
  }
}

Leave a comment