在Vue3 中,v-dompurify-html 是一个自定义指令,通常用于确保在页面中渲染的 HTML 内容是安全的,以防止跨站脚本攻击(XSS)。这个指令一般是基于 DOMPurify 库来实现的,后者是一个受信任的库,用于清理不受信任的 HTML,防止 XSS 攻击。 1. v-dompurify-html 在Vue3 中的作用 v-dompurify-html 的主要作用是自动...
v-dompurify-html的实现原理主要包括两部分:Vue.js的过滤器机制和DOMPurify的安全过滤。当我们在Vue.js中使用v-dompurify-html进行HTML内容过滤时,其内部机制如下: 1.用户在模板中使用v-dompurify-html过滤器对需要显示的HTML内容进行处理。 2. Vue.js解析模板数据并调用v-dompurify-html过滤器。 3. v-dompurify-ht...
"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": "vue-dompurify-html-example-vue3", "private": true, "dependencies":...
3,387 Commits .github examples packages/vue-dompurify-html .gitignore .prettierignore .prettierrc LICENSE README.md SECURITY.md eslint.config.mts package.json pnpm-lock.yaml pnpm-workspace.yaml shell.nix tsconfig.json turbo.json vue-dompurify-html ...