Answer the question
In order to leave comments, you need to log in
Why doesn't vue store the object in an array?
Started learning vue yesterday.
I want to make sure that when entering a word, the name is saved in the array and after displaying it as a card, where the new value is located.
Here is the code
data() {
return {
ticker: "default",
tickers: [
{name: 'Demonstration', price: "5500"},
{name: 'Demonstration1', price: "6500"},
{name: 'Demonstration2', price: "7500"},],
};
},
methods: {
addTicker() {
const newTicker = {name:this.ticker, price: '8500'}
this.tickers.push(newTicker);
},
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question