From 9df3c19fe80d15870b4ba7aa397089841708530a Mon Sep 17 00:00:00 2001 From: n7best Date: Sun, 10 Apr 2016 22:43:29 -0400 Subject: [PATCH] #58, patched searchbar, add iconSize for toast #62, change weui dependency to 0.4.1 (#63) --- docs/toast.md | 1 + example/pages/toast/index.js | 18 ++++- package.json | 2 +- src/components/searchbar/searchbar.js | 7 +- src/components/toast/toast.js | 7 +- test/toast.js | 98 ++++++++++++++++----------- 6 files changed, 88 insertions(+), 45 deletions(-) diff --git a/docs/toast.md b/docs/toast.md index 09667cf..08b6be7 100644 --- a/docs/toast.md +++ b/docs/toast.md @@ -6,6 +6,7 @@ 属性 | 类型 | 默认值 | 可选值 | 备注 -----|------|--------|-------|------| icon|string|toast|所有icon| +iconSize|string|'small'|small, large| icon size show|bool|false|| 是否显示 示例: diff --git a/example/pages/toast/index.js b/example/pages/toast/index.js index fe48ef2..6334f83 100644 --- a/example/pages/toast/index.js +++ b/example/pages/toast/index.js @@ -13,8 +13,10 @@ export default class ToastDemo extends React.Component { state = { showToast: false, showLoading: false, + showCustom: false, toastTimer: null, - loadingTimer: null + loadingTimer: null, + customTimer: null }; componentWillUnmount() { @@ -26,7 +28,13 @@ export default class ToastDemo extends React.Component { return ( + + waiting... 完成 正在加载中... @@ -48,4 +56,12 @@ export default class ToastDemo extends React.Component { this.setState({showLoading: false}); }, 2000); } + + showCustom() { + this.setState({showCustom: true}); + + this.state.customTimer = setTimeout(()=> { + this.setState({showCustom: false}); + }, 2000); + } }; \ No newline at end of file diff --git a/package.json b/package.json index 88dc383..ce019e2 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,6 @@ "url-loader": "^0.5.7", "webpack": "^1.12.2", "webpack-dev-server": "^1.12.1", - "weui": "^0.4.0" + "weui": "^0.4.1" } } diff --git a/src/components/searchbar/searchbar.js b/src/components/searchbar/searchbar.js index 81ec426..df1ca1e 100644 --- a/src/components/searchbar/searchbar.js +++ b/src/components/searchbar/searchbar.js @@ -72,7 +72,12 @@ class SearchBar extends React.Component { onChange={this.changeHandle.bind(this)} value={this.state.text} /> - + {/*React will not trigger onMouseDown when not onClick presented*/} + e/*issues #59*/} + onMouseDown={this.clearHandle.bind(this)} + />