Giter Site home page Giter Site logo

Comments (3)

1008611 avatar 1008611 commented on May 22, 2024 5

i used the customButtonClick to upload pictures(change the base64 to img url ) . i can get the img url but can not insert the img url in content.

      customButtonClick(){

        var range = this.$refs.myTextEditor.quillEditor.getSelection()
        var length = range.index;

        var imageUrl = 'http://xxxxx/content/images/thumbs/0004868.jpeg'

        this.quillEditor.insertEmbed(length, 'image', imageUrl);
      },

getSelection()
insertEmbed() all undefined
is customButton can not get the content focus

I have solved this problem by using a Clumsy method:

      onEditorFocus(editor) {
//        console.log('editor focus!', editor)
        this.editor = editor
      },
      onEditorReady(editor) {
//        console.log('editor ready!', editor)
        this.editor = editor
      },

      customButtonClick(){

        var range

        if (this.editor.getSelection() != null) {
          range = this.editor.getSelection()
          this.length = range.index
        } else {
          this.length = this.content.length
        }
        this.$el.querySelector('.custom-input').click();

      },
...
other code  same as [#21](https://github.com/surmon-china/vue-quill-editor/issues/21)@SkyFire-Lee    to upload img (base64  to url)       get the imgUrl
...
  finally  insert  the imgUrl
  this.editor.insertEmbed(this.length, 'image', this.imgUrl);

vue-quill-editor base64 to imgUrl

from vue-quill-editor.

surmon-china avatar surmon-china commented on May 22, 2024 1

看到简书文章了,是dmeo 代码中实例名称定义错误,应该是quill,而非quillEditor

from vue-quill-editor.

shockwavemoto avatar shockwavemoto commented on May 22, 2024

Try to search for your issue, it may have already been answered or even fixed in the development branch.

It is required that you clearly describe the steps necessary to reproduce the issue you are running into. Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.

It is recommended that you make a JSFiddle/JSBin/Codepen to demonstrate your issue. You could start with this template that already includes the latest version of Vue.

For potential SSR (Server Side Rendering) issue or bugs that involves build setups, you can create a reproduction repository with steps in the README.

If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.

from vue-quill-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.