From bb39b91dc36cda91277e78426b7f4cb891592e0b Mon Sep 17 00:00:00 2001 From: Markus Waitl Date: Tue, 17 Oct 2023 12:02:59 +0200 Subject: [PATCH] Add documentation for allowed attributes --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index d74cfaa..0739b58 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,18 @@ It is also possible to provide custom allowed tags directly to the directive tag ``` +#### allowedAttributes + +Array of strings. Default: [] + +Customize the tag attributes that are allowed to be rendered: + +```js +Vue.use(VueSafeHTML, { + allowedTags: ['a'], + allowedAttributes: ['title', 'class', 'href'], +}); + ### Nuxt `vue-safe-html` is written as a Vue plugin so you can easily use it inside Nuxt by following [the Nuxt documentation](https://nuxtjs.org/docs/2.x/directory-structure/plugins#vue-plugins).