問題描述在vue-element-admin中表單提交時(shí),復(fù)選框提交數(shù)據(jù),字段如何有數(shù)組轉(zhuǎn)為字符串?相關(guān)代碼<template>……<el-checkbox-group v-model="resumeForm.fruit">
<el-checkbox label="香蕉" name="fruit"></el-checkbox>
<el-checkbox label="蘋果" name="fruit"></el-checkbox>
<el-checkbox label="西瓜" name="fruit"></el-checkbox>
<el-checkbox label="得力" name="fruit"></el-checkbox>
<el-checkbox label="橘子" name="fruit"></el-checkbox></el-checkbox-group></templaye<script>
……
data() { return { fruit:[]
}
}
</script>你期待的結(jié)果是什么?實(shí)際看到的錯(cuò)誤信息又是什么?表單提交后:字段是數(shù)組形式,如下:fruit[0]:香蕉
fruit[1]:蘋果
……如何將提交的字段轉(zhuǎn)為字符串的形式:fruit:香蕉,蘋果?
在vue-element-admin中表單提交時(shí),復(fù)選框提交數(shù)據(jù),字段如何有數(shù)組轉(zhuǎn)為字符串?
達(dá)令說
2018-11-19 17:15:34