'How do I convert Vue JS templates to pure HTML
Good day, I have been asked to convert an entire VueJs template into pure HTML to use it in Angular.
I have access to all of Vue's files, in fact the entire code base, but is there a 'quick' way to convert these templates to regular HTML?
Solution 1:[1]
There's no tool for it. Here are the basics:
:attribute="x"orv-bind:attribute="x"=>[attribute]="x"for custom attributes[attr.attribute]="x"for native HTML attributes[(attribute)]="x"for two-way binding (inputs)
@event="x"orv-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-elsereference moves on the*ngIfelement:*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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
