Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cascader组件的defaultValue #3470

Closed
dodospace opened this issue Oct 18, 2016 · 5 comments
Closed

Cascader组件的defaultValue #3470

dodospace opened this issue Oct 18, 2016 · 5 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@dodospace
Copy link

dodospace commented Oct 18, 2016

发生问题的环境是:

  • antd 版本: 2.1.0
  • 操作系统及其版本: mac
  • 浏览器及其版本: Chrome 54.0

您做了什么?

引入Cascader组件设置默认值

const { Cascader } = antd;

const options = [{
  value: 'zhejiang',
  label: 'Zhejiang',
  children: [{
    value: 'hangzhou',
    label: 'Hangzhou',
    children: [{
      value: 'xihu',
      label: 'West Lake',
    }],
  }],
}, {
  value: 'jiangsu',
  label: 'Jiangsu',
  children: [{
    value: 'nanjing',
    label: 'Nanjing',
    children: [{
      value: 'zhonghuamen',
      label: 'Zhong Hua Men',
    }],
  }],
}];

const App = React.createClass({
  handleCity(value) {
    console.log(value);
  },
  render() {
    return (
      <div style={{margin: 10}}>
        <Cascader defaultValue={['zhejiang', 'hangzhou', 'xihu']} options={options} onChange={this.handleCity}/>
      </div>
    );
  }
});

ReactDOM.render(<App />, document.getElementById('container'));

您期待的结果是:

能显示默认的地区城市

实际上的结果是:

没有任何改变,跟初始化一样,官网上的默认值Demo也是这个样子,并没起作用

@afc163 afc163 self-assigned this Oct 18, 2016
@afc163 afc163 added the 🐛 Bug Ant Design Team had proved that this is a bug. label Oct 18, 2016
@afc163
Copy link
Member

afc163 commented Oct 18, 2016

笔误。

@ohmyauthentic
Copy link

@afc163 那重新install 还是?

@afc163
Copy link
Member

afc163 commented Oct 27, 2016

等待新版发布吧。

@ohmyauthentic
Copy link

@afc163 好的,非常感谢

@lock
Copy link

lock bot commented May 3, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants