vue-dompurify-html - npm 三、nuxt3项目使用 3.1、安装vue-dompurify-html pnpm add vue-dompurify-html 3.2、plugins/vueInject.js // 防止使用v-html发生跨站脚本攻击XSSimport VueDOMPurifyHTML from 'vue-dompurify-html'export default defineNuxtPlugin(nuxtApp => {nuxtApp.vueApp.use(VueDOMPurifyHTML)}) ...
import VueDOMPurifyHTML from 'vue-dompurify-html'; export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.use(VueDOMPurifyHTML); });You can use the same configuration options than the Vue setup. You can see a complete example with some advanced configuration in the Nuxt 3 example....
importVueDOMPurifyHTMLfrom'vue-dompurify-html';exportdefaultdefineNuxtPlugin((nuxtApp) =>{ nuxtApp.vueApp.use(VueDOMPurifyHTML); }); You can use the same configuration options than the Vue setup. You can see a complete example with some advanced configuration in theNuxt 3 example. Note:due t...
155export default defineNuxtPlugin((nuxtApp) => { 156nuxtApp.vueApp.use(VueDOMPurifyHTML); 157}); 158``` 159 160You can use the same configuration options than the Vue setup. You can see a complete example 161with some advanced configuration in the [Nuxt 3 example](../../examples/nux...
"@nuxt/devtools": "1.3.6", "nuxt": "3.12.2", "vue": "3.4.29", "vue": "3.4.30", "vue-dompurify-html": "workspace:*" } } 2 changes: 1 addition & 1 deletion 2 examples/vue3/package.json Original file line numberDiff line numberDiff line change @@ -2,7 +2,7 @@ "name...
LeSuisse/vue-dompurify-htmlPublic NotificationsYou must be signed in to change notification settings Fork24 Star299 Code Issues3 Pull requests1 Actions Security Insights Additional navigation options Files main .github examples packages .gitignore ...
and then tell Nuxt to use it asclient-side pluginin your Nuxt config: exportdefault{plugins:[{src:'~/plugins/dompurify',mode:'client'}]} Server side The usage is similar than when directly using Vue but you need to setup DOMPurify to work with Node. ...
I never used Nuxt so I'm not sure I'm going to be of a big help here. Two guesses: did you try with the3.0.0-alpha.3version since recent version of Nuxt uses Vue 3? did you seeMake DOMPurify work in Node.jscure53/DOMPurify#29since SSR might be involved?
Drop unused vue-router dep from Nuxt 3 example LeSuissecommittedDec 15, 2023 226efaf Add Nuxt 3 example LeSuissecommittedDec 15, 2023 9f6eb6c Do not hide env variables when publishing the package LeSuissecommittedDec 15, 2023 bea1318 Commits on Dec 13, 2023 ...
and then tell Nuxt to use it asclient-side pluginin your Nuxt config: exportdefault{plugins:[{src:'~/plugins/dompurify',mode:'client'}]} Server side The usage is similar than when directly using Vue but you need to setup DOMPurify to work with Node. ...