diff --git a/template.md b/template.md new file mode 100644 index 0000000..d0ad3ca --- /dev/null +++ b/template.md @@ -0,0 +1,40 @@ +# 模板 +> 模板语法基于原生的字符串模板, 并实现了一套指令, 提供类似`vue`的API. + + + +## 基础用法示例 + +```js + +import { html, Component } from 'wkit' + +class Foo extends Component { + + render() { + return html` +

Hello Wkit!

+ ` + } +} +``` + + +### 渲染变量 + +```js +class Foo extends Component { + static props = { + name: 'Wkit' + } + + ... + + render() { + return html` +

Hello ${this.name}!

+ ` + } + +} +``` \ No newline at end of file