Giter Site home page Giter Site logo

Implement in a Vue project about dynamicquilltools HOT 3 OPEN

t-vk avatar t-vk commented on August 13, 2024
Implement in a Vue project

from dynamicquilltools.

Comments (3)

marcioelias avatar marcioelias commented on August 13, 2024 2

Answering my own question, for those that my need this same solution...

Here is my Editor markup using the component for Vuejs
<quill-editor ref="emailMessageEditor" v-model="emailAction.emailMessage"></quill-editor>

on mounted() hook of the Vuejs component, I call a method to create the new select on my editor
mounted() { this.addCustomSelectToEditor() }
and here is the code of the method addCustomSelectToEditor()

addCustomSelectToEditor() {
    const quill = this.$refs.emailMessageEditor.quill

    const dropDownItems = {
        'Mike Smith': '[email protected]',
        'Jonathan Dyke': '[email protected]',
        'Max Anderson': '[email protected]'
    }

    const myDropDown = new QuillToolbarDropDown({
        label: "Email Addresses",
        rememberSelection: false
    })

    myDropDown.setItems(dropDownItems)

    myDropDown.onSelect = function(label, value, quill) {
        // Do whatever you want with the new dropdown selection here

        // For example, insert the value of the dropdown selection:
        const { index, length } = quill.selection.savedRange
        quill.deleteText(index, length)
        quill.insertText(index, value)
        quill.setSelection(index + value.length)
    }

    myDropDown.attach(quill)
}

from dynamicquilltools.

abdallahboucedraya avatar abdallahboucedraya commented on August 13, 2024 1

I get an error: 'QuillToolbarDropDown' is not defined.eslint

const myDropDown = new QuillToolbarDropDown({
        label: "Email Addresses",
        rememberSelection: false
    })

@lincolnlemos
@marcioelias
@T-vK

from dynamicquilltools.

lincolnlemos avatar lincolnlemos commented on August 13, 2024

How did you import the script at your file @marcioelias ?

Also, did you figure out any way to have this as a plugin so it can be global?

from dynamicquilltools.

Related Issues (5)

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.