一覧へ戻る
fergaldoyle/rollup-plugin-vue-template-compiler(新しいタブで開きます)
主要言語: JavaScript
- star 数
- 2
- watcher 数
- 1
- fork 数
- 2
- issue 数
- 1
- 最終更新
- 2019/04/04
主要言語: JavaScript
Rollup plugin to compile Vue.js 2.0 templates.
npm i rollup-plugin-vue-template-compiler --save-dev
import vueTemplateCompiler from 'rollup-plugin-vue-template-compiler'; import buble from 'rollup-plugin-buble'; export default { entry: 'index.js', dest: 'dist/app.js', format: 'umd', plugins: [ vueTemplateCompiler({ include: '**/*.html' }), buble() ] };
import template from './template.html'
template will be an object
{ render: Function, staticRenderFns: Array<Function> }
Set render and staticRenderFns properties on a component e.g:
// manually import template from './template.html' export const myComponent = { render: template.render, staticRenderFns: template.staticRenderFns, mounted () {} } // mixin import template from './template.html' export const myComponent = { mixins: [template], mounted () {} } // stage2 object spread import template from './template.html' export const myComponent = { ...template, mounted () {} }