Skip to content

Commit 4bfbc28

Browse files
committed
chore: update lib name
1 parent 8c619e9 commit 4bfbc28

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

README.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 简介
22
使用render函数,在canvas中创建文档流,实现静态布局.
3-
点击查看 [DEMO](https://gitjinfeiyang.github.io/easyFlow/example/)
3+
4+
*点击查看 [DEMO](https://gitjinfeiyang.github.io/easyFlow/example/)*
45

56
- 支持文档流,参照web,无需设置x、y以及宽高
67
- 兼容小程序以及web,无第三方依赖
@@ -44,15 +45,17 @@
4445
- [x] position `static` `absolute`
4546

4647

47-
## Screenshot
48-
![1](screenshot/01.png)
48+
## Installation
4949

50+
``` bash
51+
npm install easy-canvas-layout --save
52+
```
5053

5154
## Usage
5255

5356
### Basic
5457
``` javascript
55-
import ef from 'easyflow'
58+
import easyCanvas from 'easy-canvas-layout'
5659

5760
const canvas = document.querySelector('#canvas')
5861

@@ -62,15 +65,15 @@
6265
ctx.scale(2, 2)
6366

6467
// create a layer bind with ctx
65-
const layer = ef.createLayer(ctx, {
68+
const layer = easyCanvas.createLayer(ctx, {
6669
dpr: 2,
6770
width: 300,
6871
height: 600,
6972
canvas // 小程序环境必传
7073
})
7174

7275
// create a node tree
73-
const node = ef.createElement((c) => {
76+
const node = easyCanvas.createElement((c) => {
7477
return c('view', { styles: { backgroundColor:'#000' } }, [
7578
c('text',{color:'#fff'},'Hello World')
7679
])
@@ -114,9 +117,9 @@
114117
)
115118
}
116119

117-
ef.component('button',(opt,children,c) => button(c,children))
120+
easyCanvas.component('button',(opt,children,c) => button(c,children))
118121

119-
const node = ef.createElement((c) => {
122+
const node = easyCanvas.createElement((c) => {
120123
return c('view',{},[
121124
c('button',{},'这是全局组件')
122125
])

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "easy-canvas",
2+
"name": "easy-canvas-layout",
33
"version": "0.0.1",
4-
"description": "A canvas lib helps us easy to layout with canvas.",
4+
"description": "A canvas tool to help easy layout in canvas.",
55
"main": "./lib/index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
@@ -17,7 +17,7 @@
1717
"bugs": {
1818
"url": "https://github.com/Gitjinfeiyang/easyFlow/issues"
1919
},
20-
"homepage": "https://github.com/Gitjinfeiyang/easyFlow#readme",
20+
"homepage": "https://github.com/Gitjinfeiyang/easy-canvas#readme",
2121
"devDependencies": {
2222
"rollup-plugin-terser": "^7.0.0"
2323
}

0 commit comments

Comments
 (0)