sanitize-vue3
A simple component to sanitize and parse HTML in vue3 and ts
6,585
| Install | |
|---|---|
npm install sanitize-vue3 |
|
| Latest Version: | 1.0.8 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Jan 23, 2023 |
| Links: | GitHub · npm |
Maintainer: bpsmartdesign
sanitize-vue3
A simple component to sanitize and parse HTML for Vue.js 3 - Vite - Ts apps.
The use of v-html if very risky and NOT RECOMMENDED especially when the contents can be sent by the User 😕. You definitely might need to sanitize and parse that content. This plugin is built for Vue 3 - Vite apps and supports TypeScript. It is built upon on sanitize-html.
Install
yarn add sanitize-vue3
# or
npm install --save sanitize-vue3
Usage
Global Usage
Register the component globally
import { SanitizeVue3 } from "sanitize-vue3";
const app = createApp(App); // App should be probably your main App.vue component or something else
app.component("SanitizeVue3", SanitizeVue3);
Local Usage
Use the component locally
import { SanitizeVue3 } from "sanitize-vue3";
And use it on template like
<template>
<SanitizeVue3 html="youHtmlCode" />
</template>
Issues
If you find any bugs, please open an issue.
Contributing
- Fork it
- Create your feature branch:
git checkout -b feature-or-bugfix - Add your changes:
git add files - Commit your changes:
git commit -m "Add some feature" - Push to the branch:
git push origin feature-or-bugfix - Submit a forked pull request
License
See License File.
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.0.8 | ^3.2.37 | MIT | |
| 1.0.7 | ^3.2.37 | MIT | |
| 1.0.6 | ^3.2.37 | MIT | |
| 1.0.5 | ^3.2.37 | MIT | |
| 1.0.4 | ^3.2.37 | MIT | |
| 1.0.3 | ^3.2.37 | MIT | |
| 1.0.2 | ^3.2.37 | MIT | |
| 1.0.1 | ^3.2.37 | MIT | |
| 1.0.0 | ^3.2.37 | MIT |