Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

antd 示例代码问题 #563

Open
iwangx opened this issue Jul 13, 2019 · 2 comments
Open

antd 示例代码问题 #563

iwangx opened this issue Jul 13, 2019 · 2 comments

Comments

@iwangx
Copy link

iwangx commented Jul 13, 2019

地址:https://braft.margox.cn/demos/antd-upload
代码

  uploadHandler = (param) => {

    if (!param.file) {
      return false
    }
  
    this.setState({
      editorState: ContentUtils.insertMedias(this.state.editorState, [{
        type: 'IMAGE',
        url: URL.createObjectURL
      }])
    })

  }

应修改为

  uploadHandler = (param) => {

    if (!param.file) {
      return false
    }
  
    this.setState({
      editorState: ContentUtils.insertMedias(this.state.editorState, [{
        type: 'IMAGE',
        url: URL.createObjectURL(param.file)
      }])
    })

  }
@margox
Copy link
Owner

margox commented Jul 29, 2019

哈哈,一直忘记改了,不好意思

@macc6579
Copy link

macc6579 commented Aug 7, 2019

地址:https://braft.margox.cn/demos/antd-upload
代码

  uploadHandler = (param) => {

    if (!param.file) {
      return false
    }
  
    this.setState({
      editorState: ContentUtils.insertMedias(this.state.editorState, [{
        type: 'IMAGE',
        url: URL.createObjectURL
      }])
    })

  }

应修改为

  uploadHandler = (param) => {

    if (!param.file) {
      return false
    }
  
    this.setState({
      editorState: ContentUtils.insertMedias(this.state.editorState, [{
        type: 'IMAGE',
        url: URL.createObjectURL(param.file)
      }])
    })

  }

还有个问题。。导入的 ImageUtils 是不是没有用到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants