-
I saw some addons were using scripts in I tried a similar thing: import naive from "naive-ui";
import { defineAppSetup } from "@slidev/types";
export default defineAppSetup(({ app }) => {
app.use(naive);
console.log("naive-ui setup");
alert("naive-ui setup");
}); But this wasn't executed -- alert window didn't pop up, nor did I see any console msg. Under what conditions, will my code in |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@7086cmd Tagging you here since I saw you using Another example: https://github.com/KermanX/slidev-addon-python-runner/blob/main/setup/code-runners.ts |
Beta Was this translation helpful? Give feedback.
-
Only code with the exact file name as described in the docs will run (in Node.js or in the browser). For example, according to https://sli.dev/custom/config-vue, the code you provided must be put inside |
Beta Was this translation helpful? Give feedback.
Only code with the exact file name as described in the docs will run (in Node.js or in the browser).
For example, according to https://sli.dev/custom/config-vue, the code you provided must be put inside
./setup/main.ts
based on where yourslides.md
is. Then the code will run in the browser without the need of any extra configuration.