Dont work style in link in tiptap in nuxt 3

74 Views Asked by At

why dont work link in tiptap in nuxt 3? I have brobleb only with style, beause when i send on server i see link and on site i can go to link which create but style not work i mean link not became blue color as usually its work. in my code i created button

 <button @click="onLinkClick" :class="{ 'is-active': editor.isActive('link') }">
        <i class="ri-link"></i>
      </button>

later create method where setlink or unsetlink in text

const onLinkClick = () =>{
  const previousUrl = editor.value.getAttributes('link').href
      const url = window.prompt('URL', previousUrl)

      // cancelled
      if (url === null) {
        return
      }

      // empty
      if (url === '') {
        editor.value
          .chain()
          .focus()
          .extendMarkRange('link')
          .unsetLink()
          .run()

        return
      }

      // update link
      editor.value
        .chain()
        .focus()
        .extendMarkRange('link')
        .setLink({ href: url })
        .run()
    
}

and later write in mounted this

 Link.configure({
          openOnClick: false,
        })
0

There are 0 best solutions below