$("#fileinput-demo-1").fileinput({
‘theme’: ‘explorer-fas’,
‘uploadUrl’: ctx + ‘common/bootstrap/upload’,
// uploadAsync: true,
overwriteInitial: false,
initialPreviewAsData: true,
initialPreview: productImgs,
initialPreviewConfig: productConfigList,
allowedFileExtensions: [‘jpg’, ‘png’, ‘gif’, ‘jpeg’],//接收的文件后缀
}).on(“fileuploaded”, function (event, data, previewId, index) {
if (data.response.code == 0) {
var imgs = $(’#accessory’).val();
if (imgs != null && imgs != ‘’) {
$(’#accessory’).val(imgs + ‘,’ + data.response.fileName);
} else {
$(’#accessory’).val(data.response.fileName);
}
$(’#’ + previewId).attr(‘myOperationData’, data.response.fileName);
}
}).on(“filesuccessremove”, function (event, data, previewId, index) {
// 取出我设置好的数据
var myData = $(’#’ + data).attr(‘myOperationData’);
KaTeX parse error: Expected 'EOF', got '#' at position 3: ('#̲accessory').val…(’#accessory’).val().replace(myData, ‘’).replace(’,’, ‘,’));
})
#fileinput 文件的上传和删除
最新推荐文章于 2022-10-11 10:14:45 发布