Safe replacement for the v-html directive. Latest version: 5.2.0, last published: 2 months ago. Start using vue-dompurify-html in your project by running `npm i vue-dompurify-html`. There are 30 other projects in the npm registry using vue-dompurify-html
npm install vue-dompurify-html@vue-legacy dompurify jsdom In your Nuxt config you will need to setup a "server-side" directive: exportdefault{render:{bundleRenderer:{directives:{'dompurify-html':(el,dir)=>{constinsertHook=buildVueDompurifyHTMLDirective({},()=>{constwindow=newJSDOM('').windo...
首先,你需要在你的 Vue 项目中安装 vue-dompurify-html。你可以使用 npm 或 yarn 进行安装: bash npm install vue-dompurify-html # 或者 yarn add vue-dompurify-html 2. 引入 vue-dompurify-html 到Vue 组件 在你的 Vue 项目的主要入口文件(通常是 main.js 或main.ts)中引入 vue-dompurify-html 并使用...
v-html可能引起跨站脚本攻击(Cross-Site Scripting 简称 XSS)。 所以,在网站上动态渲染任意 HTML 是非常危险的,因为容易导致 [XSS攻击]。只在可信内容上使用 v-html,永不用在用户提交的内容上。 仅用于展示的内容个人觉得可以使用。为了避免出现特殊情况,本文介绍一个插件“vue-dompurify-html”。 二、npm vue-do...
npm install vue-dompurify-html The current version is only compatible with Vue 3. If you need Vue 2 support use a 4.1.x version. Usage You can see setup examples in theexamples/folder. import{ createApp }from'vue';importAppfrom'./App.vue';importVueDOMPurifyHTMLfrom'vue-dompurify-html';...
UNPKG vue-dompurify-html/README.md Version: 4.66 kBMarkdownView Raw 1# vue-dompurify-html 2 3[![npm](https://img.shields.io/npm/v/vue-dompurify-html)](https://www.npmjs.com/package/vue-dompurify-html) 4[![Build Status](https://github.com/LeSuisse/vue-dompurify-html/actions/workflow...
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script> </head> <body> <div id="app"> <div class="outer"> <div class="menu"> <div class="item"> <div class="title"> 菜单一</div> <div class="con"> ...
The App runs just fine with npm run serve, but the test fails with the above error. I have managed to get a bit closer to the source of the issue, but can't figure out how to fix it: When run inside the test, the require statement inside node_modules/vue-dompurify-html/dist/dompu...
npm install vue-dompurify-html@vue-legacy dompurify jsdom In your Nuxt config you will need to setup a "server-side" directive: exportdefault{render:{bundleRenderer:{directives:{'dompurify-html':(el,dir)=>{constinsertHook=buildVueDompurifyHTMLDirective({},()=>{constwindow=newJSDOM('').windo...