[Vuejs]-How to import extrenal library on mounted hook in Nuxt Js?

0👍

This is a rare situation that you may need to use the <client-only> tag. If you’re using a version older than 2.9.0, then it is <no-ssr>. Docs found here.

Example:

<template>
  <client-only>
    <form id="my-form-element" cf-form></form>
  </client-only>
</template>
<script>
import * as cf from 'conversational-form'

export default { ... }
</script>

This instructs Nuxt to only render the component client side, where window is defined.

Leave a comment