feature(uniapp商品): 新增商品

This commit is contained in:
luowenfeng
2022-08-23 20:27:39 +08:00
parent 81666e3b62
commit 8ad1439fda
6 changed files with 156 additions and 93 deletions

View File

@ -85,8 +85,8 @@ export default {
value: {
handler(val) {
if (val) {
// 首先将值转为数组
const list = Array.isArray(val) ? val : this.value.split(',');
// 首先将值转为数组, 当只穿了一个图片时会报map方法错误
const list = Array.isArray(val) ? val : Array.isArray(this.value.split(',')) ? this.value.split(','): Array.of(this.value);
// 然后将数组转为对象数组
this.fileList = list.map(item => {
if (typeof item === "string") {