[Vuejs]-Vuejs: how to remove curly bracket "{}" in vuejs

2👍

create a computed property in which you could replace the curly brackets by empty string :

computed:{
     customDay(){
         return this.obj.data.day.replace(/[{}]/g,'');
   }
}

1👍

You can use regex to achieve it

let a = '{1,2}'
a = a.replace(/[{}]/g, '');
console.log(a)

Leave a comment