Skip to content

Commit

Permalink
Merge pull request #623 from chantouchsek/revert-598-vue3_fix
Browse files Browse the repository at this point in the history
Revert "Changing the Vue prototype object to work with Vue 2 or 3."
  • Loading branch information
chantouchsek authored Jan 18, 2024
2 parents df1b2c7 + 1755303 commit 082b44b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/sanitize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ const VSanitize = {
const { name = 'sanitize' } = defaultOptions;
delete defaultOptions.name
const options1 = { ...defaultOptions } as IOptions

const vueProto = Vue?.config?.globalProperties ?? Vue.prototype;
vueProto[`$${name}`] = (dirty: string, opts = undefined) => sanitizeHtml(dirty, opts || options1);

Vue.prototype[`$${name}`] = (dirty: string, opts = undefined) => sanitizeHtml(dirty, opts || options1);
Vue.directive(name, (el, binding) => {
if (binding.value !== binding.oldValue) {
if (Array.isArray(binding.value)) {
Expand Down

0 comments on commit 082b44b

Please sign in to comment.