Answer the question
In order to leave comments, you need to log in
How to correctly pass data to the template?
Good afternoon.
Tell me how to correctly specify the data output in the template, provided that the value can be a string or a number?
Those. if the content is not the amount, but the text
"cost": 1000, // the currency (₽) from the
"cost": "Agreement" template is also added here, // it should not be here
Example (cost):
"table": [
{
"title": "Selection",
"capt": "",
"cost": 1000,
"fullcontent": ""
},
{
"title": "1 page",
"capt": "",
"cost": "Agreement",
"fullcontent": ""
},
<h4>{{ p.title }}</h4>
<p><strong>Cost: {{ p.cost }} ₽</strong></p>
Answer the question
In order to leave comments, you need to log in
<span v-for="(p, index) in table" :key="index">
<h4>{{ p.title }}</h4>
<p><strong>Cost: {{ p.cost }} ₽</strong></p>
</span>
data: {
table: [...]
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question