Vue how does an array contain a variable?

clipboard.png

above is the effect I want, where 10 and 3 are variables.
I tried this and showed underfine

return{
    list_tabs:["" + this.people_reply],
    people_reply:10, //
    people_none:3, //
}

tried string concatenation of ES6, but it didn"t work

list_tabs:["`${people_reply}`"],

how to solve a situation like this?

Nov.15,2021

list_tabs should be placed in the computed of vue, not in data.


 list_tabs:["" + people_reply],
    people_reply:10, //
    people_none:3, //

Why don't you write that?


list_tabs: ["answered" + this.people_reply], no, because it doesn't know this.people_reply exists when this code takes effect.
list_tabs: [" answered ${people_reply} "] this is called a template string, and the correct way to write it is without double quotation marks. Also make sure that people_reply exists.
it is recommended that you put list_tabs in computed.


you spelled it wrong. Es6 string concatenation should be like this

list_tabs:[`${people_reply}`],

Why not define a variable outside the array and put it in

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c7bc-2ba95.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c7bc-2ba95.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?