Vue-Template-Ast-To-Template
Transform compiled template ast to vue template.It expose all key vue template property hook for you to overwrite.So you can transform vue template to other template base on vue template ast.
How to
Install
npm install vue-template-transformer --save
Usage
const TemplateTransform = // extend the base template transform { // do something for v-if directive } { // do something for v-for directive } // get an instanceconst newTemplateTranformer = // some options prefix: 'foo' // inject the origin vue template ast and call generate method of transformer instance to get the transformed templateconst code = newTemplateTranformer
All instance properties that can be overwrite:
Directives
- genVIf(
v-if
) - genVFor(
v-for
) - genEvents(
v-on|@
) - genVShow(
v-show
) - genVModel(
v-model
) - genVOnce(
v-once
) - genVBind(
v-bind|:
) - genVCloak(
v-cloak
) - genVHtml(
v-html
) - genVPre(
v-pre
) - genVText(
v-text
)
Attrs
- genAttrs
- genStyle
- genClass
- genKey
- genIs
- genRef
- genSlot
- genScopedSlot