[Vuejs]-Vue + Asp.Net MVC – Using vue mustache in cshtml attributes

1πŸ‘

I think you are trying to bind row.id to textbox id attribute. You should do it like below.

<input v-bind:id="props.row.Id" customeAttr="price" type="text" v-model="props.row.Price">

OR you can change your model data to have a get property which can return custom string like β€˜price-β€˜ + id.

{
  id: 1,
  price: 10,
  get customId() {        
    return 'price-' + this.id;
  }      
}

Detailed Example

πŸ‘€Nitin Rastogi

Leave a comment