vue js access data in method
data: function () {
return {
questions: [],
sendButtonDisable : false
}
},
methods: {
postQuestionsContent : function() {
// This works here.
this.sendButtonDisable = true;
// The view model.
var vm = this;
setTimeout(function() {
// This does not work, you need the outside context view model.
//this.sendButtonDisable = true;
// This works, since wm refers to your view model.
vm.sendButtonDisable = true;
}, 1000);
}
}
Also in JavaScript:
- javascript code for find the last element in array
- create express server local
- access css property using javascript
- javascript string first letter lowercase
- angular 8 remove cookies
- jquery slideup
- How to test useEffect in react testing library
- capitalize first letter of each word javascript
- action checkbox selected vue js
- Discord bot client login
- javascript find smallest number in an array
- jquery with svelte
- how to Write a program that simulates a coin toss using random method of Javascript Math class
- express js post request body
- notice before reload js
- hiding header in a specific screen in react native
- use theme in component mui
- what 1hr in milliseconds in javascript
- resizing div js
- return this javascript
- create function javascript
- jest expect not contain
- can i use hooks with expo in react native
- calculator