Tree: fix registerNode error when nodeKey is 0

This commit is contained in:
Leopoldthecoder 2017-04-24 13:44:27 +08:00
parent 7036276b8a
commit 1c4ff99508
4 changed files with 4 additions and 3 deletions

View File

@ -12,6 +12,7 @@
![JS gzip size](http://img.badgesize.io/https://unpkg.com/element-ui/lib/index.js?compression=gzip&label=gzip%20size:%20JS)
![CSS gzip size](http://img.badgesize.io/https://unpkg.com/element-ui/lib/theme-default/index.css?compression=gzip&label=gzip%20size:%20CSS)
[![Join the chat at https://gitter.im/ElemeFE/element](https://badges.gitter.im/ElemeFE/element.svg)](https://gitter.im/ElemeFE/element?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join the chat at https://gitter.im/element-en/Lobby](https://badges.gitter.im/element-en/Lobby.svg)](https://gitter.im/element-en/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![OpenCollective](https://opencollective.com/element/backers/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/element/sponsors/badge.svg)](#sponsors)

View File

@ -698,7 +698,7 @@
### 手风琴模式
每次只打开一个同级树节点展开
对于同一级的节点,每次只能展开一个
::: demo
```html

View File

@ -132,7 +132,7 @@ export default class TreeStore {
if (!key || !node || !node.data) return;
const nodeKey = node.key;
if (nodeKey) this.nodesMap[node.key] = node;
if (nodeKey !== undefined) this.nodesMap[node.key] = node;
}
deregisterNode(node) {

View File

@ -5,7 +5,7 @@ function getError(action, option, xhr) {
} else if (xhr.responseText) {
msg = `${xhr.status} ${xhr.responseText}`;
} else {
msg = `fail to post ${action} ${xhr.status}'`;
msg = `fail to post ${action} ${xhr.status}`;
}
const err = new Error(msg);