uview-pro 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## 0.6.1(2026-05-13)
2
+
3
+ ### ✨ Features | 新功能
4
+
5
+ - **theme:** 添加默认颜色变量的RGB值支持 ([59af59f](https://github.com/anyup/uView-Pro/commit/59af59f5ea160155939ec4c6c3e33f968910c3e4))
6
+ - **u-picker:** 支持自定义标题插槽并调整样式 ([c3f2967](https://github.com/anyup/uView-Pro/commit/c3f296718a53449665cf14441ed1adef817274d1))
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ - **release:** bump version to 0.6.0 ([cb7351f](https://github.com/anyup/uView-Pro/commit/cb7351fe85e96a5abcd2d4eea0c1771f62148fd0))
11
+
12
+ ### 🐛 Bug Fixes | Bug 修复
13
+
14
+ - **canvas:** 修复头条小程序中CanvasContext的Illegal invocation错误 ([05ebe29](https://github.com/anyup/uView-Pro/commit/05ebe2998007421cf2d2db8664bbe2963419129f))
15
+
16
+ ### 👥 Contributors
17
+
18
+ <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
19
+
1
20
  ## 0.6.0(2026-05-12)
2
21
 
3
22
  ### ✨ Features | 新功能
@@ -21,7 +21,11 @@
21
21
  >
22
22
  {{ cancelText }}
23
23
  </view>
24
- <view class="u-picker__title u-line-1">{{ title }}</view>
24
+ <view class="u-picker__title u-line-1">
25
+ <slot name="title">
26
+ {{ title }}
27
+ </slot>
28
+ </view>
25
29
  <view
26
30
  class="u-btn-picker u-btn-picker--primary"
27
31
  :style="{ color: moving ? cancelColor : confirmColor }"
@@ -777,7 +781,7 @@ onMounted(() => {
777
781
 
778
782
  .u-picker-header {
779
783
  width: 100%;
780
- height: 90rpx;
784
+ min-height: 90rpx;
781
785
  @include vue-flex;
782
786
  justify-content: space-between;
783
787
  align-items: center;
@@ -4,7 +4,46 @@
4
4
  * @returns
5
5
  */
6
6
  export function canvas2d(ctx: CanvasRenderingContext2D): UniApp.CanvasContext {
7
- return Object.assign(ctx, {
7
+ // 绑定 this 到 ctx,避免头条小程序等环境中出现 Illegal invocation 错误
8
+ const boundCtx = {
9
+ arc: ctx.arc.bind(ctx),
10
+ arcTo: ctx.arcTo.bind(ctx),
11
+ beginPath: ctx.beginPath.bind(ctx),
12
+ bezierCurveTo: ctx.bezierCurveTo.bind(ctx),
13
+ clearRect: ctx.clearRect.bind(ctx),
14
+ clip: ctx.clip.bind(ctx),
15
+ closePath: ctx.closePath.bind(ctx),
16
+ createImageData: ctx.createImageData.bind(ctx),
17
+ createLinearGradient: ctx.createLinearGradient.bind(ctx),
18
+ createPattern: ctx.createPattern.bind(ctx),
19
+ createRadialGradient: ctx.createRadialGradient.bind(ctx),
20
+ drawImage: ctx.drawImage.bind(ctx),
21
+ fill: ctx.fill.bind(ctx),
22
+ fillRect: ctx.fillRect.bind(ctx),
23
+ fillText: ctx.fillText.bind(ctx),
24
+ getImageData: ctx.getImageData.bind(ctx),
25
+ getLineDash: ctx.getLineDash.bind(ctx),
26
+ isPointInPath: ctx.isPointInPath.bind(ctx),
27
+ isPointInStroke: ctx.isPointInStroke.bind(ctx),
28
+ lineTo: ctx.lineTo.bind(ctx),
29
+ measureText: ctx.measureText.bind(ctx),
30
+ moveTo: ctx.moveTo.bind(ctx),
31
+ putImageData: ctx.putImageData.bind(ctx),
32
+ quadraticCurveTo: ctx.quadraticCurveTo.bind(ctx),
33
+ rect: ctx.rect.bind(ctx),
34
+ restore: ctx.restore.bind(ctx),
35
+ rotate: ctx.rotate.bind(ctx),
36
+ save: ctx.save.bind(ctx),
37
+ scale: ctx.scale.bind(ctx),
38
+ setLineDash: ctx.setLineDash.bind(ctx),
39
+ setTransform: ctx.setTransform.bind(ctx),
40
+ stroke: ctx.stroke.bind(ctx),
41
+ strokeRect: ctx.strokeRect.bind(ctx),
42
+ strokeText: ctx.strokeText.bind(ctx),
43
+ transform: ctx.transform.bind(ctx),
44
+ translate: ctx.translate.bind(ctx),
45
+ resetTransform: ctx.resetTransform?.bind(ctx),
46
+ roundRect: (ctx as any).roundRect?.bind(ctx),
8
47
  setFillStyle(color: string | CanvasGradient) {
9
48
  ctx.fillStyle = color;
10
49
  },
@@ -45,5 +84,99 @@ export function canvas2d(ctx: CanvasRenderingContext2D): UniApp.CanvasContext {
45
84
  createCircularGradient() {},
46
85
  draw() {},
47
86
  addColorStop() {}
48
- }) as unknown as UniApp.CanvasContext;
87
+ };
88
+ // 复制属性访问器
89
+ Object.defineProperties(boundCtx, {
90
+ fillStyle: {
91
+ get: () => ctx.fillStyle,
92
+ set: value => {
93
+ ctx.fillStyle = value;
94
+ }
95
+ },
96
+ strokeStyle: {
97
+ get: () => ctx.strokeStyle,
98
+ set: value => {
99
+ ctx.strokeStyle = value;
100
+ }
101
+ },
102
+ lineWidth: {
103
+ get: () => ctx.lineWidth,
104
+ set: value => {
105
+ ctx.lineWidth = value;
106
+ }
107
+ },
108
+ lineCap: {
109
+ get: () => ctx.lineCap,
110
+ set: value => {
111
+ ctx.lineCap = value;
112
+ }
113
+ },
114
+ lineJoin: {
115
+ get: () => ctx.lineJoin,
116
+ set: value => {
117
+ ctx.lineJoin = value;
118
+ }
119
+ },
120
+ miterLimit: {
121
+ get: () => ctx.miterLimit,
122
+ set: value => {
123
+ ctx.miterLimit = value;
124
+ }
125
+ },
126
+ globalAlpha: {
127
+ get: () => ctx.globalAlpha,
128
+ set: value => {
129
+ ctx.globalAlpha = value;
130
+ }
131
+ },
132
+ globalCompositeOperation: {
133
+ get: () => ctx.globalCompositeOperation,
134
+ set: value => {
135
+ ctx.globalCompositeOperation = value;
136
+ }
137
+ },
138
+ font: {
139
+ get: () => ctx.font,
140
+ set: value => {
141
+ ctx.font = value;
142
+ }
143
+ },
144
+ textAlign: {
145
+ get: () => ctx.textAlign,
146
+ set: value => {
147
+ ctx.textAlign = value;
148
+ }
149
+ },
150
+ textBaseline: {
151
+ get: () => ctx.textBaseline,
152
+ set: value => {
153
+ ctx.textBaseline = value;
154
+ }
155
+ },
156
+ shadowOffsetX: {
157
+ get: () => ctx.shadowOffsetX,
158
+ set: value => {
159
+ ctx.shadowOffsetX = value;
160
+ }
161
+ },
162
+ shadowOffsetY: {
163
+ get: () => ctx.shadowOffsetY,
164
+ set: value => {
165
+ ctx.shadowOffsetY = value;
166
+ }
167
+ },
168
+ shadowBlur: {
169
+ get: () => ctx.shadowBlur,
170
+ set: value => {
171
+ ctx.shadowBlur = value;
172
+ }
173
+ },
174
+ shadowColor: {
175
+ get: () => ctx.shadowColor,
176
+ set: value => {
177
+ ctx.shadowColor = value;
178
+ }
179
+ }
180
+ });
181
+ return boundCtx as unknown as UniApp.CanvasContext;
49
182
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-pro",
3
3
  "name": "uview-pro",
4
4
  "displayName": "【支持鸿蒙】uView Pro|基于Vue3+TS的高质量UI组件库,支持多主题、暗黑模式、多语言",
5
- "version": "0.6.0",
5
+ "version": "0.6.1",
6
6
  "description": "uView Pro是基于Vue3+TS的多平台UI框架,提供80+高质量组件、便捷工具和常用模板,支持多主题、暗黑模式、多语言,支持H5/APP/鸿蒙/小程序多端开发。已在鸿蒙应用商店上架,欢迎体验!",
7
7
  "main": "index.ts",
8
8
  "module": "index.ts",