Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/408.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何从编辑器js手动渲染数据_Javascript_Vue.js_Editorjs - Fatal编程技术网

Javascript 如何从编辑器js手动渲染数据

Javascript 如何从编辑器js手动渲染数据,javascript,vue.js,editorjs,Javascript,Vue.js,Editorjs,我是第一次使用editor.js,我被困在这一部分:从我的图库中选择图像后,我想用新图像重新渲染editor js:这是我现在的代码 let url = `/${this.selectedImg.image.id}/${this.selectedImg.image.name}` this.editor.configuration.data.blocks.push({ data: { caption: "", file: {url: url}

我是第一次使用editor.js,我被困在这一部分:从我的图库中选择图像后,我想用新图像重新渲染editor js:这是我现在的代码

let url = `/${this.selectedImg.image.id}/${this.selectedImg.image.name}`
  this.editor.configuration.data.blocks.push({
    data: {
      caption: "",
      file: {url: url},
      stretched: false,
      withBackground: false,
      withBorder: false,
    },
    type: "image"
  })
  console.log(this.editor,'editor')
  this.editor.render()
但是
这个.editor.render()
不起作用,我缺少什么? 这是
console.log

我将感谢任何帮助

 editor.save().then((data) => {
     data.blocks.push({
       type: "image",
       data: {
         caption: "",
         file: {url: url},
         stretched: false,
         withBackground: false,
         withBorder: false,
       },
     })
     this.editor.render(data)
     this.$emit('close', true)
   })
这就是答案,我误读了文件:)