diff --git a/examples/docs/en-US/input.md b/examples/docs/en-US/input.md
index f4e54ee79..e9929fd82 100644
--- a/examples/docs/en-US/input.md
+++ b/examples/docs/en-US/input.md
@@ -608,6 +608,7 @@ Search data from server-side.
|autosize | whether textarea has an adaptive height, only works when `type` is 'textarea'. Can accept an object, e.g. { minRows: 2, maxRows: 6 } | boolean/object | — | false |
|auto-complete | same as `auto-complete` in native input | string | on/off | off |
|name | same as `name` in native input | string | — | — |
+| readonly | same as `readonly` in native input | boolean | — | false |
|max | same as `max` in native input | * | — | — |
|min | same as `min` in native input | * | — | — |
|resize| control the resizability | string | none, both, horizontal, vertical | — |
diff --git a/examples/docs/en-US/tree.md b/examples/docs/en-US/tree.md
index 7cb0f868a..7167c0d75 100644
--- a/examples/docs/en-US/tree.md
+++ b/examples/docs/en-US/tree.md
@@ -35,6 +35,44 @@
}]
}];
+ const data2 = [{
+ id: 1,
+ label: 'Level one 1',
+ children: [{
+ id: 4,
+ label: 'Level two 1-1',
+ children: [{
+ id: 9,
+ label: 'Level three 1-1-1'
+ }, {
+ id: 10,
+ label: 'Level three 1-1-2'
+ }]
+ }]
+ }, {
+ id: 2,
+ label: 'Level one 2',
+ children: [{
+ id: 5,
+ label: 'Level two 2-1'
+ }, {
+ id: 6,
+ label: 'Level two 2-2'
+ }]
+ }, {
+ id: 3,
+ label: 'Level one 3',
+ children: [{
+ id: 7,
+ label: 'Level two 3-1'
+ }, {
+ id: 8,
+ label: 'Level two 3-2'
+ }]
+ }];
+
+ let id = 1000;
+
const regions = [{
'name': 'region1'
}, {
@@ -48,12 +86,18 @@
children: 'zones'
};
- var defaultProps = {
+ const defaultProps = {
children: 'children',
label: 'label'
};
export default {
+ watch: {
+ filterText(val) {
+ this.$refs.tree2.filter(val);
+ }
+ },
+
methods: {
handleCheckChange(data, checked, indeterminate) {
console.log(data, checked, indeterminate);
@@ -89,15 +133,68 @@
resolve(data);
}, 500);
+ },
+ getCheckedNodes() {
+ console.log(this.$refs.tree.getCheckedNodes());
+ },
+ getCheckedKeys() {
+ console.log(this.$refs.tree.getCheckedKeys());
+ },
+ setCheckedNodes() {
+ this.$refs.tree.setCheckedNodes([
+ {
+ id: 5,
+ label: '二级 2-1'
+ },
+ {
+ id: 9,
+ label: '三级 1-1-1'
+ }
+ ]);
+ },
+ setCheckedKeys() {
+ this.$refs.tree.setCheckedKeys([8]);
+ },
+ resetChecked() {
+ this.$refs.tree.setCheckedKeys([]);
+ },
+ append(store, data) {
+ store.append({ id: id++, label: 'testtest', children: [] }, data);
+ },
+
+ remove(store, data) {
+ store.remove(data);
+ },
+
+ renderContent(h, { node, data, store }) {
+ return (
+
+
+ {node.label}
+
+
+