Created
December 5, 2019 11:16
-
-
Save Bachana123/e0f55d52dd27833f1a8ad8c13b1c46da to your computer and use it in GitHub Desktop.
mixin for removing any tag from passed html string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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