Safe replacement for the v-html directive. Latest version: 5.3.0, last published: 3 days ago. Start using vue-dompurify-html in your project by running `npm i vue-dompurify-html`. There are 38 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...
<script src="https:///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"> <div>111</div> ...
Actions All workflows CodeQL Dependabot Updates Publish Package to npmjs Tests & lint Management Caches Tests & lint CI.yml 1,491 workflow run results Event Status Branch Actor chore(deps): update vitest monorepo to v3.0.4 Tests & lint #7292: Commit d734d14 pushed by Le...
For Yarn 2+ docs and migration guide, see yarnpkg.com. Package detail … 0 … https://yarn.pm/… … Use it $yarn add … Try in RunKit·Browse Files Popularity Downloads last 30 days 0 jsDelivr last 30 days 0 Dependents 0
npm install vue-dompurify-html@vue-legacy dompurify jsdom In your Nuxt config you will need to setup a "server-side" directive:export default { render: { bundleRenderer: { directives: { 'dompurify-html': (el, dir) => { const insertHook = buildVueDompurifyHTMLDirective( {}, () => {...