From dd98ae85b39076a74f8bf27e2e36b9c8f3a1f52e Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 21 Sep 2023 11:00:35 +0800 Subject: [PATCH] Add template --- template.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 template.md 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