PrismJS / prism

Lightweight, robust, elegant syntax highlighting.
https://prismjs.com
MIT License
12.34k stars 1.29k forks source link

A plugin must either be a function or an object with an "install" function. #3714

Open eguvenc opened 1 year ago

eguvenc commented 1 year ago

Information:

Description I use Vue.js 3.3.4, In my main.js file i have below the lines.

import Prism from "prismjs";
import "prismjs/components/prism-markup.js";
import "prismjs/components/prism-markup-templating.js"
import "prismjs/themes/prism-dark.css"; // you can change 
import 'prismjs/components/prism-php';
import 'prismjs/components/prism-bash';

app.use(Prism);

But i get this error. image

Example No.

Golmote commented 4 weeks ago

Hello, Prism is not meant to be used directly as a Vue.js plugin. You might wanna look for a Vue-specific implementation of Prism, I believe there exists multiple ones.