render-core 1.0.37 → 1.0.38

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.
@@ -0,0 +1 @@
1
+ export declare function v_if(nodes: HTMLCollection, data: {}): void;
package/core/cmd/v-if.js CHANGED
@@ -0,0 +1,2 @@
1
+ export function v_if(nodes, data) {
2
+ }
@@ -7,13 +7,16 @@ export function resolver_show(elements, data) {
7
7
  if (data[dataName] instanceof Boolean) {
8
8
  if (data[dataName] === true) {
9
9
  // @ts-ignore
10
- elements[i].style.visibility = true;
10
+ elements[i].style.visibility = "visible";
11
11
  }
12
12
  else {
13
13
  // @ts-ignore
14
- elements[i].style.visibility = false;
14
+ elements[i].style.visibility = "hidden";
15
15
  }
16
16
  }
17
+ else {
18
+ console.log("v-show instruct should be used with boolean!");
19
+ }
17
20
  }
18
21
  var subElements = elements[i].children;
19
22
  resolver_show(subElements, data);
@@ -4,6 +4,8 @@ import { resolver_html } from "../../core/cmd/v-html";
4
4
  import { resolver_txt } from "../../core/cmd/v-txt";
5
5
  import { resolver_model } from "../../core/cmd/v-model";
6
6
  import { resolver_bind } from "../../core/cmd/v-bind";
7
+ import { resolver_show } from "../../core/cmd/v-show";
8
+ import { resolver_render } from "../../core/cmd/v-render";
7
9
  export function cmd(tagTemplate, proto, controller) {
8
10
  //给所有元素添加上npm=tag标志
9
11
  addLabel(tagTemplate.children, proto.getName());
@@ -17,6 +19,10 @@ export function cmd(tagTemplate, proto, controller) {
17
19
  resolver_model(tagTemplate.children, controller.proxyForMethods);
18
20
  //渲染属性
19
21
  resolver_bind(tagTemplate.children, controller.proxyForMethods);
22
+ //v-show
23
+ resolver_show(tagTemplate.children, controller.proxyForMethods);
24
+ //v-render
25
+ resolver_render(tagTemplate.children, controller.proxyForMethods);
20
26
  }
21
27
  export function cmdForUpdate(tagTemplate, proto, controller) {
22
28
  //给所有元素添加上npm=tag标志
@@ -29,4 +35,8 @@ export function cmdForUpdate(tagTemplate, proto, controller) {
29
35
  resolver_txt(tagTemplate.children, controller.proxyForMethods);
30
36
  //绑定数据
31
37
  resolver_model(tagTemplate.children, controller.proxyForMethods);
38
+ //v-show
39
+ resolver_show(tagTemplate.children, controller.proxyForMethods);
40
+ //v-render
41
+ resolver_render(tagTemplate.children, controller.proxyForMethods);
32
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "render-core",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
4
4
  "description": "The core for render-js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",