@dcloudio/uni-app-x 0.5.4 → 0.5.5
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/package.json +1 -1
- package/types/native/Element.d.ts +16 -12
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ interface Element {
|
|
|
19
19
|
* @autodoc false
|
|
20
20
|
*/
|
|
21
21
|
parentNode: Element | null
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
/**
|
|
24
24
|
* 获取当前元素在 DOM 树中的父元素,如果没有父元素(如未添加到DOM树中),则返回null。
|
|
25
25
|
*/
|
|
@@ -45,6 +45,7 @@ interface Element {
|
|
|
45
45
|
* 获取当前元素包含的子元素的集合
|
|
46
46
|
*/
|
|
47
47
|
children: Element[]
|
|
48
|
+
childNodes: Element[]
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* 获取当前元素的标签名
|
|
@@ -96,22 +97,22 @@ interface Element {
|
|
|
96
97
|
* 元素的左边界偏移值 单位px
|
|
97
98
|
*/
|
|
98
99
|
offsetLeft: number
|
|
99
|
-
|
|
100
|
+
|
|
100
101
|
/**
|
|
101
102
|
* 元素的右边界偏移值 单位px
|
|
102
103
|
*/
|
|
103
104
|
offsetTop: number
|
|
104
|
-
|
|
105
|
+
|
|
105
106
|
/**
|
|
106
107
|
* 元素高度 单位px
|
|
107
108
|
*/
|
|
108
109
|
offsetWidth: number
|
|
109
|
-
|
|
110
|
+
|
|
110
111
|
/**
|
|
111
112
|
* 元素宽度 单位px
|
|
112
113
|
*/
|
|
113
114
|
offsetHeight: number
|
|
114
|
-
|
|
115
|
+
|
|
115
116
|
/**
|
|
116
117
|
* 扩展属性
|
|
117
118
|
*/
|
|
@@ -131,10 +132,10 @@ interface Element {
|
|
|
131
132
|
|
|
132
133
|
/**
|
|
133
134
|
* 在参考元素之前插入一个拥有指定父元素的子元素。如果给定的子元素是对文档中现有元素的引用,insertBefore() 会将其从当前位置移动到新位置。
|
|
134
|
-
* @param
|
|
135
|
-
* @param
|
|
135
|
+
* @param newChild 插入子元素对象
|
|
136
|
+
* @param refChild 已存在父元素的子元素对象
|
|
136
137
|
*/
|
|
137
|
-
insertBefore(newChild: Element, refChild
|
|
138
|
+
insertBefore(newChild: Element, refChild?: Element | null): void
|
|
138
139
|
|
|
139
140
|
/**
|
|
140
141
|
* 设置指定元素上的某个属性值。如果设置的属性已经存在,则更新该属性值;否则使用指定的名称和值添加一个新的属性。
|
|
@@ -186,9 +187,10 @@ interface Element {
|
|
|
186
187
|
|
|
187
188
|
/**
|
|
188
189
|
* 删除使用 addEventListener 方法添加的事件监听器。
|
|
189
|
-
* @param
|
|
190
|
+
* @param type 事件类型
|
|
191
|
+
* @param callback 事件监听器 T表示event类型,R表示返回值类型
|
|
190
192
|
*/
|
|
191
|
-
removeEventListener(type: string): void
|
|
193
|
+
removeEventListener<T extends Event, R>(type: string, callback?: ((event: T) => R) | null): void
|
|
192
194
|
|
|
193
195
|
/**
|
|
194
196
|
* 从元素中删除一个子元素,返回删除的元素。
|
|
@@ -221,14 +223,16 @@ interface Element {
|
|
|
221
223
|
* @param {number} y y轴要滚动的距离(单位px)
|
|
222
224
|
*/
|
|
223
225
|
scrollBy(x: number, y: number): void
|
|
224
|
-
|
|
226
|
+
|
|
225
227
|
/**
|
|
226
228
|
* 使元素获取焦点 仅input、Textarea组件支持
|
|
227
229
|
*/
|
|
228
230
|
focus(): void
|
|
229
|
-
|
|
231
|
+
|
|
230
232
|
/**
|
|
231
233
|
* 使元素丢失焦点 仅input、Textarea组件支持
|
|
232
234
|
*/
|
|
233
235
|
blur(): void
|
|
234
236
|
}
|
|
237
|
+
|
|
238
|
+
type INode = Element
|