render-core 1.0.87 → 1.0.90
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/core/cmd/v-model.d.ts
CHANGED
package/core/cmd/v-model.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 绑定数据模型
|
|
3
|
+
* @param nodes
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
1
6
|
export function resolver_model(nodes, data) {
|
|
2
7
|
for (var i = 0; i < nodes.length; i++) {
|
|
3
|
-
|
|
4
|
-
if (result) {
|
|
8
|
+
if (nodes[i].hasAttribute("v-model")) {
|
|
5
9
|
var dataName = nodes[i].getAttribute("v-model");
|
|
6
10
|
nodes[i].removeAttribute("v-model");
|
|
7
11
|
var tagName = nodes[i].tagName;
|
package/core/inject/inject.js
CHANGED
|
@@ -42,7 +42,7 @@ export function injectMethod(controller, proto) {
|
|
|
42
42
|
export function injectWatcher(controller, proto) {
|
|
43
43
|
var methods = Object.getOwnPropertyNames(proto.getWatcher());
|
|
44
44
|
methods.forEach(function (value) {
|
|
45
|
-
Reflect.set(controller.raw_data, "w_"
|
|
45
|
+
Reflect.set(controller.raw_data, "w_".concat(value), proto.getWatcher()[value].bind(controller.raw_data));
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
/**
|
package/core/proxy/getProxy.js
CHANGED
|
@@ -21,7 +21,7 @@ export function getSetter(data, updater) {
|
|
|
21
21
|
var setter = function (obj, prop, value) {
|
|
22
22
|
//检查是否有watcher
|
|
23
23
|
try {
|
|
24
|
-
obj["
|
|
24
|
+
obj["w_".concat(prop)](obj[prop], value);
|
|
25
25
|
}
|
|
26
26
|
catch (e) {
|
|
27
27
|
console.log(e.message);
|
|
@@ -12,8 +12,7 @@ export function addLabel(nodes, component) {
|
|
|
12
12
|
}
|
|
13
13
|
export function bindModelForUpdater(nodes, data) {
|
|
14
14
|
for (var i = 0; i < nodes.length; i++) {
|
|
15
|
-
|
|
16
|
-
if (result) {
|
|
15
|
+
if (nodes[i].hasAttribute("v-model")) {
|
|
17
16
|
var dataName = nodes[i].getAttribute("v-model");
|
|
18
17
|
nodes[i].removeAttribute("v-model");
|
|
19
18
|
var tagName = nodes[i].tagName;
|
|
@@ -50,7 +49,6 @@ export function bindModelForUpdater(nodes, data) {
|
|
|
50
49
|
nodes[i].setSelectionRange(data[dataName].length, data[dataName].length);
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
|
|
54
|
-
bindModelForUpdater(subElements, data);
|
|
52
|
+
bindModelForUpdater(nodes[i].children, data);
|
|
55
53
|
}
|
|
56
54
|
}
|
package/library/cmd/cmd.js
CHANGED
|
@@ -52,8 +52,6 @@ export function cmdForUpdate(tagTemplate, proto, controller) {
|
|
|
52
52
|
resolver_html(tagTemplate.children, controller.proxyForMethods);
|
|
53
53
|
//渲染text
|
|
54
54
|
resolver_txt(tagTemplate.children, controller.proxyForMethods);
|
|
55
|
-
//绑定数据
|
|
56
|
-
resolver_model(tagTemplate.children, controller.proxyForMethods);
|
|
57
55
|
//v-show
|
|
58
56
|
resolver_show(tagTemplate.children, controller.proxyForMethods);
|
|
59
57
|
//v-render
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "render-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.90",
|
|
4
4
|
"description": "The core of render-js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"bin": {
|
|
8
8
|
"render-core": "./bin/bin.js"
|
|
9
9
|
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
|
-
},
|
|
13
10
|
"repository": {
|
|
14
11
|
"type": "git",
|
|
15
12
|
"url": "https://github.com//render-js/render-core.git"
|
|
16
13
|
},
|
|
17
|
-
"author":
|
|
14
|
+
"author": {
|
|
15
|
+
"name": "mutian",
|
|
16
|
+
"email": "mutian-xiangcai@outlook.com"
|
|
17
|
+
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"render-security": "^1.0.4",
|