simple-code-editor icon indicating copy to clipboard operation
simple-code-editor copied to clipboard

Is this module compatible with nuxt 3?

Open gramadaioan98 opened this issue 3 years ago • 2 comments

Is this mod compatible with nuxt 3? If not, what mode could I use?

I tried to install this module and I get this error Uncaught SyntaxError: The requested module '/_nuxt/node_modules/highlight.js/lib/index.js?v=f8fda8bf' does not provide an export named 'default' (at index.js?v=f8fda8bf:2:8)

gramadaioan98 avatar Nov 14 '22 12:11 gramadaioan98

Same error here

JulianRoyet avatar Jun 07 '23 15:06 JulianRoyet

I can't confirm this is working for me in Nuxt 3 with vuetify. I got errors when following the readme to add the module to nuxt.config.ts. However, by just skipping that and simply using the following steps it's working:

  1. run npm install simple-code-editor
  2. goto your target file on client and
import hljs from "highlight.js";
import CodeEditor from "simple-code-editor";
  1. add the component import to your default export object
components: {
    CodeEditor,
  },
  1. Add markup and bind to store:
<v-row>
    <v-col>
      <client-only>
        <CodeEditor width="100%" v-model="Store.templateText"></CodeEditor>
      </client-only>
    </v-col>
  </v-row>

res63661 avatar Jul 04 '23 06:07 res63661