Add template

master
yutent 2023-09-21 11:00:35 +08:00
parent 2ab45fea85
commit dd98ae85b3
1 changed files with 40 additions and 0 deletions

40
template.md Normal file

@ -0,0 +1,40 @@
# 模板
> 模板语法基于原生的字符串模板, 并实现了一套指令, 提供类似`vue`的API.
## 基础用法示例
```js
import { html, Component } from 'wkit'
class Foo extends Component {
render() {
return html`
<h1>Hello Wkit!</h1>
`
}
}
```
### 渲染变量
```js
class Foo extends Component {
static props = {
name: 'Wkit'
}
...
render() {
return html`
<h1>Hello ${this.name}!</h1>
`
}
}
```