<input type="text" v-on:keypress="
let letterNumber = /^[0-9a-z_]+$/;
let keyCode = ($event.keyCode ? $event.keyCode : $event.which);
let text = String.fromCharCode(keyCode);
if (! text.match(letterNumber)) {
$event.preventDefault();
}
">
月份: 2022 年 8 月
VueJS: How to output a comma separated array?
source: René Roth (2018), https://stackoverflow.com/questions/42129534/vuejs-how-to-output-a-comma-separated-array
If all you care about is comma separation, use Javascript’s built-in join method:
{{ list.join(', ') }}
For arrays of objects, you could do something like this:
{{ list.map(entry => entry.title).join(', ') }}