render-core 1.2.11 → 1.2.13

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.
@@ -11,8 +11,8 @@ export function resolver_model(nodes, data) {
11
11
  nodes[i].removeAttribute("v-model");
12
12
  var tagName = nodes[i].tagName;
13
13
  nodes[i].setAttribute("name", dataName);
14
- if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA" || tagName === "DATALIST") {
15
- nodes[i].addEventListener("input", listerner.bind(data));
14
+ if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
15
+ nodes[i].addEventListener("onchange", listerner.bind(data));
16
16
  nodes[i].addEventListener("compositionstart", compositionstart);
17
17
  nodes[i].addEventListener("compositionend", compositionend.bind(data));
18
18
  }
@@ -2,7 +2,6 @@ import { afterCmd, cmdUtility, } from "../utility/cmdUtility";
2
2
  import { injectRefs } from "../inject/inject";
3
3
  import { findComponent } from "./delivery";
4
4
  import { getTemplate } from "../utility/templateUtility";
5
- import { resolver_model } from "../cmd/react/v-model";
6
5
  import { locateInputAddress } from "../utility/sectionUtility";
7
6
  /**
8
7
  * 更新渲染方法
@@ -26,7 +25,6 @@ export function update_Render(controller) {
26
25
  injectRefs(controller);
27
26
  //渲染后处理
28
27
  afterCmd(controller.root, controller.proto, controller);
29
- resolver_model(controller.root.children, controller.proxyForMethods);
30
28
  //获取定位
31
29
  locateInputAddress(controller);
32
30
  //深度渲染
@@ -3,19 +3,24 @@
3
3
  * @param controller
4
4
  */
5
5
  export function locateInputAddress(controller) {
6
+ //判断是否是输入导致的数据更新
6
7
  if (controller.proxyForMethods.hasOwnProperty("origin")) {
7
- var doc_1 = Reflect.get(controller.proxyForMethods, "origin");
8
+ var doc = Reflect.get(controller.proxyForMethods, "origin");
8
9
  // @ts-ignore
9
- var target = document.querySelectorAll(doc_1.tag.toLowerCase().concat("[cpn=".concat(doc_1.cpn).concat("]")));
10
- target.forEach(function (value) {
10
+ var target = document.querySelectorAll(doc.tag.toLowerCase().concat("[cpn=".concat(doc.cpn).concat("]")));
11
+ // @ts-ignore
12
+ for (var i = 0; i < target.length; i++) {
11
13
  // @ts-ignore
12
- if (value.getAttribute("name") === doc_1.name) {
14
+ if (target[i].getAttribute("name") === doc.name) {
15
+ // @ts-ignore
16
+ target[i].value = controller.proxyForMethods[doc.name];
13
17
  // @ts-ignore
14
- value.focus();
18
+ target[i].focus();
15
19
  // @ts-ignore
16
- value.setSelectionRange(controller.proxyForMethods[doc_1.name].length, controller.proxyForMethods[doc_1.name].length);
20
+ target[i].setSelectionRange(controller.proxyForMethods[doc.name].length, controller.proxyForMethods[doc.name].length);
17
21
  }
18
- });
22
+ }
23
+ //清楚输入标记
19
24
  Reflect.deleteProperty(controller.proxyForMethods, "origin");
20
25
  }
21
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "render-core",
3
- "version": "1.2.11",
3
+ "version": "1.2.13",
4
4
  "description": "The core of render-js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",