[Vuejs]-How do I convert Vue JS templates to pure HTML

2👍

There’s no tool for it. Here are the basics:

  • :attribute="x" or v-bind:attribute="x" =>
    • [attribute]="x" for custom attributes
    • [attr.attribute]="x" for native HTML attributes
    • [(attribute)]="x" for two-way binding (inputs)
  • @event="x" or v-on:event="x" => (event)="x"
  • v-for="(item, key) in items" :key="key" => *ngFor="let item of items;let key=index;"
  • v-if="x" => *ngIf="x"
  • v-else reference moves on the *ngIf element: *ngIf="x; else other" and somewhere in your component you define <ng-template #other>...other content here</ng-template>

If you run into edge cases, ask, and I’ll update the answer.
You might find this useful.

Leave a comment