Skip to content

Instantly share code, notes, and snippets.

@Bachana123
Created December 5, 2019 11:16
Show Gist options
  • Save Bachana123/e0f55d52dd27833f1a8ad8c13b1c46da to your computer and use it in GitHub Desktop.
Save Bachana123/e0f55d52dd27833f1a8ad8c13b1c46da to your computer and use it in GitHub Desktop.
mixin for removing any tag from passed html string
import Vue from 'vue'
Vue.mixin({
methods: {
removeTag(string, tag) {
var regex = "/<\/?(" + tag + ")\b[^<>]*>/g"
return string.replace( regex, "")
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment