Skip to content

How can I populate suggestion items dynamically? #765

Discussion options

You must be logged in to vote

-----[SOLVED]-----
Assigning reference of this.items to items inside new Mention() works!
After that, you can push or delete items from this.items and that changes suggestion items too!

data () {  
  return {
    items: [
      { id: 1, name: 'A' },
      { id: 2, name: 'B' },
      { id: 3, name: 'C' },
      { id: 4, name: 'D' }
    ],
    editor: new Editor ({
      extensions: [
        new Mention({
          item: this.items,
          // ........
        })
      ]
    }) 
  }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hanspagel
Comment options

Answer selected by plstreatmewell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants