Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

上传图片成功后,界面不会显示,是需要特殊配置吗? #5

Open
lancerhe opened this issue Oct 6, 2017 · 2 comments
Assignees

Comments

@lancerhe
Copy link

lancerhe commented Oct 6, 2017

image

正常情况下请求完成后会显示在面板上已经上传的图片,但实际停止了。

page-edit.component.ts

  @ViewChild('um') um: UMeditorComponent;

  config: any = {
    toolbar: [
      'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |',
      'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize',
      '| justifyleft justifycenter justifyright justifyjustify |',
      'link unlink | emotion image ',
      '| horizontal print preview fullscreen']
    , imageUrl: "http://admin.dev.yaf-template.com/umeditor/imageupload"             //图片上传提交地址
    , imagePath: "http://admin.dev.yaf-template.com/upload/"                     //图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置
    , imageFieldName: "upfile"                   //图片数据的key,若此处修改,需要在后台对应文件修改对应参数
  };

  onLoad() {
    this.um.Instance.setContent(this.page.content);
  }

  onChange(content: string) {
    this.page.content = content;
  }

page-edit.component.html

<umeditor [(ngModel)]="page.content"
                        [ngModelOptions]="{standalone: true}"
                        [config]="config"
                        [path]="'./assets/umeditor/'"
                        [loadingTip]="'加载中……'"
                        (onReady)="onLoad($event)"
                        (onContentChange)="onChange($event)" #um></umeditor>

@cipchk
Copy link
Owner

cipchk commented Oct 6, 2017

ngx-umeditor 只是单纯一个组件的封装,并不会被 umeditor 有任何的数据处理;

插件图片时有触发 onChange 吗?

@lancerhe
Copy link
Author

lancerhe commented Oct 6, 2017

image

上传完成后会停留在这个上,不会触发onChange,正常情况下这个界面上会出现已经上传的图片,然后点这个图片,图片会插入到编辑器中

@cipchk cipchk self-assigned this Nov 15, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants