render-core 1.3.33 → 1.3.34
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { compositionend, compositionstart,
|
|
1
|
+
import { compositionend, compositionstart, listener } from "../../utility/modelUtility";
|
|
2
2
|
/**
|
|
3
3
|
* 绑定数据模型
|
|
4
4
|
* @param nodes
|
|
@@ -13,7 +13,7 @@ export function resolver_model(nodes, data) {
|
|
|
13
13
|
nodes[i].setAttribute("name", dataName);
|
|
14
14
|
if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
|
|
15
15
|
nodes[i].addEventListener("compositionstart", compositionstart);
|
|
16
|
-
nodes[i].addEventListener("input",
|
|
16
|
+
nodes[i].addEventListener("input", listener.bind(data));
|
|
17
17
|
nodes[i].addEventListener("compositionend", compositionend.bind(data));
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -79,9 +79,7 @@ function editType(element, space) {
|
|
|
79
79
|
export function filesType(element, space) {
|
|
80
80
|
Reflect.set(space, "origin", {
|
|
81
81
|
tag: element.tagName,
|
|
82
|
-
id: element.getAttribute("id")
|
|
83
|
-
// @ts-ignore
|
|
84
|
-
files: element.files
|
|
82
|
+
id: element.getAttribute("id")
|
|
85
83
|
});
|
|
86
84
|
}
|
|
87
85
|
export function selectUtility(element, space) {
|
|
@@ -10,7 +10,7 @@ export function compositionstart(evt) {
|
|
|
10
10
|
*
|
|
11
11
|
* @param evt
|
|
12
12
|
*/
|
|
13
|
-
export function
|
|
13
|
+
export function listener(evt) {
|
|
14
14
|
if (!evt.target.hasAttribute("flag")) {
|
|
15
15
|
//Get the event element
|
|
16
16
|
var element = evt.target;
|
|
@@ -29,7 +29,12 @@ export function listerner(evt) {
|
|
|
29
29
|
break;
|
|
30
30
|
}
|
|
31
31
|
//Update the value
|
|
32
|
-
|
|
32
|
+
if (element.type === "file") {
|
|
33
|
+
this[element.name] = element.files;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this[element.name] = element.value;
|
|
37
|
+
}
|
|
33
38
|
}
|
|
34
39
|
}
|
|
35
40
|
/**
|