在 Vue 中,可以使用 JSON.stringify() 函数将 v-for 循环的数组转换为字符串,然后再发送出去。
例如:
<template>
<div>
<button @click="sendData">发送数据</button>
</div>
</template>
<script>
export default {
data() {
return {
list: [1, 2, 3, 4]
};
},
methods: {
sendData() {
const data = JSON.str