0👍
You have to duplicate your object, one containing the current state the other one the new state. When pushing the button, you update the current state.
export default {
name: "Measurements",
created() {
this.newState = JSON.parse(JSON.stringify(this.currentState));
},
data () {
return {
currentState: { },
newState: {}
};
},
methods: {
addItems() {
this.currentState= JSON.parse(JSON.stringify(this.newState));
}
}
};
- [Vuejs]-Initialize data attribute object with prop object passed from parent
- [Vuejs]-Dynamically set default baseURL for axios
0👍
Just add a new variable to determine the visible/hidden state of your input. You can do so by adding a v-if
to your html element and adjusting your addItems
method just like that.
data: () => {
return {
...
showHeight: false,
...
};
},
methods: {
addItems() {
this.showHeight = true;
}
}
- [Vuejs]-How to create datetime value following the server time on vue/quasar?
- [Vuejs]-How to set same props to many components?
Source:stackexchange.com