askbot-dragon 0.7.58 → 0.7.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "0.7.58",
3
+ "version": "0.7.59",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -21,20 +21,22 @@ export default class ImageCommand extends Command {
21
21
  document.body.appendChild(inputObj);
22
22
  inputObj.click();
23
23
  inputObj.onchange = () => {
24
- this.upload(inputObj.files[0]).then(res =>{
25
- console.log(res);
26
- let command = this.editor.commands.get("insertAskComponent");
27
- command.execute({
28
- tag: "img",
29
- options: {
30
- width:'100px',
31
- height:'100px',
32
- name: res.default,
33
- src: res.default
34
- },
35
- });
36
- })
37
-
24
+ // 循环上传文件
25
+ let files = inputObj.files;
26
+ for (let index = 0; index < files.length; index++) {
27
+ const filed = files[index];
28
+ this.upload(filed).then(res =>{
29
+ let command = this.editor.commands.get("insertAskComponent");
30
+ command.execute({
31
+ tag: "img",
32
+ options: {
33
+ width:'100%',
34
+ name: res.default,
35
+ src: res.default
36
+ },
37
+ });
38
+ })
39
+ }
38
40
  }
39
41
  }
40
42