我创建了一个自定义组件,但问题是当我预览或导出该组件时,图像不会导出
{
/* ... */
"attributes": [
{
"name": "bkgmap",
"label": "bkgmap",
"type": "string",
"required": true,
"description": "desc",
"gwdSpecific": {
"label": "bkgmapImg",
"sync": "src"
}
},
{
"name": "bkgback",
"label": "bkgback",
"type": "string",
"required": true,
"description": "desc",
"gwdSpecific": {
"label": "bkgbackImg",
"sync": "src"
}
},
{
"name": "bkgfore",
"label": "bkgfore",
"type": "string",
"required": true,
"description": "desc",
"gwdSpecific": {
"label": "bkgforeImg",
"sync": "src"
}
},
{
"name": "bar",
"label": "bar",
"type": "string",
"required": true,
"description": "desc",
"gwdSpecific": {
"label": "barImg",
"sync": "src"
}
} /* ... */
],
}
这样,通过同步属性,我只能导出一张图像,有人知道如何实现图像包含吗?还有人知道如何设置文件上传类型吗?属性类型"file"有效,但无法选择任何文件,即使我指定了接受属性也是如此。
最佳答案
{
"name": "dragIcon",
"label": "Drag Icon",
"type": "file",
"description": "Choose the images",
"required": true,
"accept": "image/*",
"bindable": false
},
关于google-web-designer - GWD 定制组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58347533/