Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/plugin/admin/app/common/Layui.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ public function uploadImage($options)
[$label, $field, $value, $props, $verify_string, $required_string, $class] = $this->options($options);
$props['acceptMime'] = $props['acceptMime'] ?? 'image/gif,image/jpeg,image/jpg,image/png';
$props['url'] = $props['url'] ?? '/app/admin/upload/image';
$props['multiple'] = $props['multiple'] ? 1 : 0;
$props['multiple'] = $props['multiple'] ?? 0;

$id = $this->createId($field);

Expand Down Expand Up @@ -1070,12 +1070,17 @@ public static function buildTable($table, int $indent = 0)
EOF;
} else {
$templet = <<<EOF

templet: function (d) {
const images = d['$field'].split(',');
let html = '';
let html = '';
if(d['$field']){
const images = d['$field'].split(',');

for (let img of images) {
html += '<img src="' + encodeURI(img.trim()) + '" style="max-width:32px;max-height:32px;" alt="" />';
}
}

return html;
}
EOF;
Expand Down