This commit is contained in:
yumoqing 2025-09-28 16:18:48 +08:00
parent ac882bfaf8
commit a8f71d7269

View File

@ -581,13 +581,6 @@ bricks.UiImage =class extends bricks.UiFile {
} }
accept_photo(camera, event){ accept_photo(camera, event){
camera.dismiss(); camera.dismiss();
if (this.imgw){
this.remove_widget(this.imgw);
}
this.imgw = new bricks.Image({
url:event.params,
width:'100%'
});
this.value = event.params this.value = event.params
this.dispatch('changed', this.value); this.dispatch('changed', this.value);
// this.add_widget(this.imgw); // this.add_widget(this.imgw);
@ -597,6 +590,9 @@ bricks.UiImage =class extends bricks.UiFile {
if (params instanceof File){ if (params instanceof File){
params = [ params ]; params = [ params ];
} }
if (params instanceof String){
params = [ params ];
}
this.preview.clear_widgets(); this.preview.clear_widgets();
params.forEach( f => { params.forEach( f => {
this._show_image(f); this._show_image(f);
@ -606,7 +602,7 @@ bricks.UiImage =class extends bricks.UiFile {
_show_image(file) { _show_image(file) {
const reader = new FileReader(); const reader = new FileReader();
reader.onload = (e) => { reader.onload = (e) => {
imgw = new bricks.Image({ var imgw = new bricks.Image({
url:file, url:file,
width:'100%' width:'100%'
}); });