Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textbranch1 #1

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
*/.DS_Store
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,47 @@
工作中公司业务需要的微信小程序用户签字功能
准备将其组件化,并加强功能性开发,优化渲染逻辑

## 组件
将components/handwriting 引入小程序中

要使用的页面 index.wxml
```html
<import src="../../components/handwriting/handwriting.wxml" />
<View>
<template is="handwriting"></template>
</View>
```

使用JS index.js
```js
onLoad: function (options) {
this.handwriting = new Handwriting(this, {
lineColor: this.data.lineColor,
slideValue: this.data.slideValue,
})
},

// 初始化需传入两个参数
// lineColor 字体颜色 默认#1A1A1A
// slideValue 字体粗细 默认50(内置 0,25,50, 75, 100 5档粗细)

/**
* example:
* this.handwriting = new Handwriting(this, {
lineColor: '#1A1A1A',
slideValue: 50,
})
*/

// 两个内置函数
this.handwriting.selectColorEvent(color); // 传入颜色参数 改变字体颜色
this.handwriting.selectSlideValue(slideValue); // 传入粗细参数 0,25,50,75,100 改变字体粗细
```


## 更新计划
1. 组件化
2. 优化setData过于频繁照成的渲染延迟
3. 增加笔迹样式
3. 增加笔迹样式

#新增测试
1 change: 1 addition & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"pages": [
"pages/handwriting/handwriting",
"pages/index/index"
],
"window": {
Expand Down
Loading