Bläddra i källkod

Chore: exclude play file from eslint, remove es-doc notification

Leopoldthecoder 7 år sedan
förälder
incheckning
8ded46c83b
4 ändrade filer med 40 tillägg och 39 borttagningar
  1. 1 0
      .eslintignore
  2. 25 25
      examples/app.vue
  3. 2 2
      examples/docs/en-US/tree.md
  4. 12 12
      examples/docs/zh-CN/tree.md

+ 1 - 0
.eslintignore

@@ -1,5 +1,6 @@
 src/utils/popper.js
 src/utils/date.js
+examples/play
 *.sh
 node_modules
 lib

+ 25 - 25
examples/app.vue

@@ -237,7 +237,7 @@
               location.href = location.href.replace('element.', 'element-cn.');
             })
             .catch(() => {
-              localStorage.setItem('PREFER_GITHUB', true);
+              localStorage.setItem('PREFER_GITHUB', 'true');
             });
         }, 1000);
       }
@@ -248,30 +248,30 @@
       if (this.lang === 'zh-CN') {
         this.suggestJump();
       }
-      setTimeout(() => {
-        const notified = localStorage.getItem('ES_NOTIFIED_2');
-        if (!notified && this.lang !== 'es') {
-          const title = this.lang === 'zh-CN'
-            ? '西班牙语文档正式上线'
-            : 'Spanish docs now available';
-          const message = this.lang === 'zh-CN'
-            ? '点击这里进行切换'
-            : 'Click here to switch';
-          const self = this;
-          this.$notify({
-            title,
-            duration: 0,
-            message,
-            onClick() {
-              self.$router.push('/es');
-              localStorage.setItem('ES_NOTIFIED_2', 1);
-            },
-            onClose() {
-              localStorage.setItem('ES_NOTIFIED_2', 1);
-            }
-          });
-        }
-      }, 3500);
+      // setTimeout(() => {
+      //   const notified = localStorage.getItem('ES_NOTIFIED_2');
+      //   if (!notified && this.lang !== 'es') {
+      //     const title = this.lang === 'zh-CN'
+      //       ? '西班牙语文档正式上线'
+      //       : 'Spanish docs now available';
+      //     const message = this.lang === 'zh-CN'
+      //       ? '点击这里进行切换'
+      //       : 'Click here to switch';
+      //     const self = this;
+      //     this.$notify({
+      //       title,
+      //       duration: 0,
+      //       message,
+      //       onClick() {
+      //         self.$router.push('/es');
+      //         localStorage.setItem('ES_NOTIFIED_2', 1);
+      //       },
+      //       onClose() {
+      //         localStorage.setItem('ES_NOTIFIED_2', 1);
+      //       }
+      //     });
+      //   }
+      // }, 3500);
     }
   };
 </script>

+ 2 - 2
examples/docs/en-US/tree.md

@@ -938,7 +938,7 @@ Only one node among the same level can be expanded at one time.
 | node-key              | unique identity key name for nodes, its value should be unique across the whole tree | string                      | —               | —       |
 | props                 | configuration options, see the following table | object                      | —               | —       |
 | render-after-expand   | whether to render child nodes only after a parent node is expanded for the first time | boolean | — | true |
-| load                  | method for loading subtree data, lazy prop must be true  | function(node, resolve)     | —               | —       |
+| load                  | method for loading subtree data, only works when `lazy` is true  | function(node, resolve)     | —               | —       |
 | render-content        | render function for tree node            | Function(h, { node, data, store }        | —               | —       |
 | highlight-current     | whether current node is highlighted      | boolean                     | —               | false   |
 | default-expand-all    | whether to expand all nodes by default   | boolean                     | —               | false   |
@@ -951,7 +951,7 @@ Only one node among the same level can be expanded at one time.
 | filter-node-method    | this function will be executed on each node when use filter method. if return `false`, tree node will be hidden. | Function(value, data, node) | —               | —       |
 | accordion             | whether only one node among the same level can be expanded at one time | boolean                     | —               | false   |
 | indent                | horizontal indentation of nodes in adjacent levels in pixels | number                     | —    | 16 |
-| lazy              |  lazy load leaf node used with load method  | boolean                     | —    | false |
+| lazy                  | whether to lazy load leaf node, used with `load` attribute  | boolean                     | —    | false |
 
 ### props
 | Attribute | Description                              | Type   | Accepted Values | Default |

+ 12 - 12
examples/docs/zh-CN/tree.md

@@ -930,27 +930,27 @@
 :::
 
 ### Attributes
-| 参数                    | 说明                                       | 类型                          | 可选值  | 默认值   |
+| 参数                  | 说明                                               | 类型                        | 可选值  | 默认值   |
 | --------------------- | ---------------------------------------- | --------------------------- | ---- | ----- |
-| data                  | 展示数据                                     | array                       | —    | —     |
-| empty-text            | 内容为空的时候展示的文本                             | String                      | —    | —     |
+| data                  | 展示数据                                           | array                       | —    | —     |
+| empty-text            | 内容为空的时候展示的文本                           | String                      | —    | —     |
 | node-key              | 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的               | String                      | —    | —     |
 | props                 | 配置选项,具体看下表                               | object                      | —    | —     |
 | render-after-expand   | 是否在第一次展开某个树节点后才渲染其子节点         | boolean                      | —    | true |
-| load                  | 加载子树数据的方法,lazy属性必须为true                                | function(node, resolve)     | —    | —     |
+| load                  | 加载子树数据的方法,仅当 lazy 属性为true 时生效    | function(node, resolve)     | —    | —     |
 | render-content        | 树节点的内容区的渲染 Function                      | Function(h, { node, data, store }        | —    | —     |
-| highlight-current     | 是否高亮当前选中节点,默认值是 false。                   | boolean                     | —    | false |
+| highlight-current     | 是否高亮当前选中节点,默认值是 false。             | boolean                     | —    | false |
 | default-expand-all    | 是否默认展开所有节点                               | boolean                     | —    | false |
 | expand-on-click-node  | 是否在点击节点的时候展开或者收缩节点, 默认值为 true,如果为 false,则只有点箭头图标的时候才会展开或者收缩节点。 | boolean                     | —    | true  |
-| auto-expand-parent    | 展开子节点的时候是否自动展开父节点                        | boolean                     | —    | true  |
-| default-expanded-keys | 默认展开的节点的 key 的数组                         | array                       | —    | —     |
-| show-checkbox         | 节点是否可被选择                                 | boolean                     | —    | false |
+| auto-expand-parent    | 展开子节点的时候是否自动展开父节点                 | boolean                     | —    | true  |
+| default-expanded-keys | 默认展开的节点的 key 的数组                        | array                       | —    | —     |
+| show-checkbox         | 节点是否可被选择                                   | boolean                     | —    | false |
 | check-strictly        | 在显示复选框的情况下,是否严格的遵循父子不互相关联的做法,默认为 false   | boolean                     | —    | false |
-| default-checked-keys  | 默认勾选的节点的 key 的数组                         | array                       | —    | —     |
+| default-checked-keys  | 默认勾选的节点的 key 的数组                        | array                       | —    | —     |
 | filter-node-method    | 对树节点进行筛选时执行的方法,返回 true 表示这个节点可以显示,返回 false 则表示这个节点会被隐藏 | Function(value, data, node) | —    | —     |
-| accordion             | 是否每次只打开一个同级树节点展开                         | boolean                     | —    | false |
-| indent                | 相邻级节点间的水平缩进,单位为像素                        | number                     | —    | 16 |
-| lazy                  | 懒加载子节点,与load方法结合一起用                     | boolean                     | —    | false |
+| accordion             | 是否每次只打开一个同级树节点展开                   | boolean                     | —    | false |
+| indent                | 相邻级节点间的水平缩进,单位为像素                 | number                     | —    | 16 |
+| lazy                  | 是否懒加载子节点,需与 load 方法结合使用           | boolean                     | —    | false |
 
 ### props
 | 参数       | 说明                | 类型     | 可选值  | 默认值  |