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