一覧へ戻る
yuekcc/rollup-plugin-vue3-template-compiler(新しいタブで開きます)
主要言語: JavaScript
a rollup plugin
- star 数
- 0
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 0
- 最終更新
- 2020/09/27
主要言語: JavaScript
a rollup plugin
a rollup plugin for compiling vue3 template into render function.
only work on browser(DOM) with vue 3.0, not support ssr.
$ npm i rollup-plugin-vue3-template-compiler --save-dev
import vueTemplateCompiler from 'rollup-plugin-vue3-template-compiler'; import buble from '@rollup/plugin-buble'; export default { input: "src/index.js", output: { format: "iife", file: "dist/bundle.js" }, plugins: [ // add this plugin // include option is require. vueTemplateCompiler({include: "src/**/*.template.html"}), buble() ] }
import { defineComponent } from "vue"; // import the template file. rollup will parse it with this plugin. import render from "./tips.template.html"; export const Tips = defineComponent({ setup() { return { tips: 'hello, world' } }, render, // the render function transform from 'tips.template.html' });
<div>{{tips}}</div>
special thank you: fergaldoyle/rollup-plugin-vue-template-compiler