@tarojs/plugin-platform-harmony-ets 4.0.0-beta.28 → 4.0.0-beta.29
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.
|
@@ -109,12 +109,14 @@ export default struct TaroButton {
|
|
|
109
109
|
build() {
|
|
110
110
|
if (this.node?.hmStyle?.display !== 'none') {
|
|
111
111
|
Button({ stateEffect: !this.node._attrs.disabled }) {
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
if (this.node._attrs.loading) {
|
|
113
|
+
Row() {
|
|
114
114
|
LoadingProgress()
|
|
115
115
|
.width(20).height(20)
|
|
116
116
|
.color(getThemeAttributes(this.node).color)
|
|
117
|
+
this.createLazyChildren(this.node)
|
|
117
118
|
}
|
|
119
|
+
} else {
|
|
118
120
|
this.createLazyChildren(this.node)
|
|
119
121
|
}
|
|
120
122
|
}
|
|
@@ -188,7 +188,7 @@ export class TaroElement<
|
|
|
188
188
|
return this._style
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
//
|
|
191
|
+
// 伪元素,不存在style动态设置,均已被转换为鸿蒙样式
|
|
192
192
|
// 可根据实际情况,迁移到具体的组件中,如View、ScrollView中,Text\Image其实是不需要的
|
|
193
193
|
public _pseudo_before: StyleSheet | null = null
|
|
194
194
|
|
|
@@ -219,4 +219,22 @@ export class TaroElement<
|
|
|
219
219
|
this._pseudo_after = null
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
+
|
|
223
|
+
// 伪类,在获取的时候根据dom和parent的关系,动态设置
|
|
224
|
+
public _pseudo_class: Record<string, StyleSheet | null> = {
|
|
225
|
+
// ["::first-child"]: new StyleSheet(),
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
public set_pseudo_class(name: string, value: HarmonyStyle | null) {
|
|
229
|
+
if (value) {
|
|
230
|
+
if (!this._pseudo_class[name]) {
|
|
231
|
+
this._pseudo_class[name] = new StyleSheet()
|
|
232
|
+
}
|
|
233
|
+
Object.keys(value).forEach(key => {
|
|
234
|
+
this._pseudo_class[name]!.hmStyle[key] = value[key]
|
|
235
|
+
})
|
|
236
|
+
} else {
|
|
237
|
+
this._pseudo_class[name] = null
|
|
238
|
+
}
|
|
239
|
+
}
|
|
222
240
|
}
|
|
@@ -38,25 +38,6 @@ export function convertNumber2PX (value: number) {
|
|
|
38
38
|
return pxTransformHelper(value, 'vp')
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
// 全局的变量内容
|
|
42
|
-
export const globalCss = {
|
|
43
|
-
map: {}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Css变量的var方法
|
|
47
|
-
export function __var_fn(value: string | (() => string), ...rest: any[]) {
|
|
48
|
-
if (typeof value === 'function') {
|
|
49
|
-
const res = value()
|
|
50
|
-
return typeof res !== 'undefined' ? res : (rest && (rest instanceof Array ? __var_fn.apply(null, rest) : __var_fn(rest)))
|
|
51
|
-
}
|
|
52
|
-
return typeof value !== 'undefined' ? value: (rest && (rest instanceof Array ? __var_fn.apply(null, rest) : __var_fn(rest)))
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Css变量的var方法,延迟获取变量
|
|
56
|
-
export function __lazy_var_fn(fn, ...rest: any[]) {
|
|
57
|
-
return () => (fn() || __var_fn.apply(null, rest))
|
|
58
|
-
}
|
|
59
|
-
|
|
60
41
|
export function convertNumber2VP (value: number, unit = 'px') {
|
|
61
42
|
if (unit === 'vw' || unit === 'vh') {
|
|
62
43
|
return (value / 100 * (unit === 'vw' ? display.width: display.height)) + 'px'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/plugin-platform-harmony-ets",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.29",
|
|
4
4
|
"description": "OpenHarmony & 鸿蒙系统插件",
|
|
5
5
|
"author": "O2Team",
|
|
6
6
|
"homepage": "https://gitee.com/openharmony-sig/taro",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"webpack-sources": "^3.2.3",
|
|
28
|
-
"@tarojs/
|
|
29
|
-
"@tarojs/
|
|
30
|
-
"@tarojs/runner-utils": "4.0.0-beta.
|
|
31
|
-
"@tarojs/runtime": "4.0.0-beta.
|
|
32
|
-
"@tarojs/service": "4.0.0-beta.
|
|
33
|
-
"@tarojs/shared": "4.0.0-beta.
|
|
34
|
-
"@tarojs/taro": "4.0.0-beta.
|
|
28
|
+
"@tarojs/helper": "4.0.0-beta.29",
|
|
29
|
+
"@tarojs/components": "4.0.0-beta.29",
|
|
30
|
+
"@tarojs/runner-utils": "4.0.0-beta.29",
|
|
31
|
+
"@tarojs/runtime": "4.0.0-beta.29",
|
|
32
|
+
"@tarojs/service": "4.0.0-beta.29",
|
|
33
|
+
"@tarojs/shared": "4.0.0-beta.29",
|
|
34
|
+
"@tarojs/taro": "4.0.0-beta.29"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"solid-js": "^1.6.15",
|
|
45
45
|
"tslib": "^2.4.0",
|
|
46
46
|
"typescript": "^4.8.2",
|
|
47
|
-
"rollup-plugin-copy": "4.0.0-beta.
|
|
47
|
+
"rollup-plugin-copy": "4.0.0-beta.29"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"prebuild": "rimraf ./dist",
|