0
what about something like this:
watch: {
message: function() {
const replacements = {
":-)": "
",
":-(": "
",
";-)": "
",
":-|": "
",
":'-(": "
",
":-*": "
",
"*.*": "
",
";-P": "
",
"8-)": "
",
":-D": "
",
"=-D": "
"
}
Object.keys(replacements).forEach(k => {
this.message = this.message.replace(k, replacements[k])
})
}
}
- [Vuejs]-How to detect click on children vue/nux custom directive
- [Vuejs]-Make computed property available globally
Source:stackexchange.com