handleSubmit(e) { e.preventDefault() const node = this.refs.input const text = node.value.trim() if (text) { this.props.onAddSubmit(text) node.value = '' } }
keywordChange() { const {dispatch} = this.props; if (this.changeTimer) { window.clearTimeout(this.changeTimer); } // 1秒后执行搜索 let searchElement = this.refs.search; this.changeTimer = window.setTimeout(function () { dispatch(searchKeywordChanged(searchElement.value)); }, 1000); }
handleClick(e) { const node = this.refs.input const text = node.value.trim() this.props.onAddClick(text) node.value = '' }
handleSubmit(event){ event.preventDefault(); const input = this.refs.username; this.props.login(input.value); input.value="" }
/** * manageService could be used as helper in the process of adding or * editing a service, on both operation title and content are mandatory. */ manageService() { const titleRef = this.refs.title; const contentRef = this.refs.content; if (titleRef.value && contentRef.value) { this.props.manageService(titleRef.value, contentRef.value); titleRef.value = contentRef.value = ''; } }
postItem() { const todo = this.refs.todo; this.props.postItem(todo.value); todo.value = ''; }
onSubmit(e) { e.preventDefault(); const node = this.refs.channel; const channelName = node.value; this.props.addChannel(channelName); node.value = ''; }
onSubmit(e){ e.preventDefault(); const node = this.refs.userName; const userName = node.value; this.props.setUserName(userName); node.value = ''; }
handleSubmitButtonClick(e) { e.preventDefault() const {addTodo} = this.props const {nextTodoInput} = this.refs addTodo(nextTodoInput.value) nextTodoInput.value = '' }
onSubmit(e){ e.preventDefault(); const node = this.refs.message; const message = node.value; this.props.addMessage(message); node.value = ''; }
handleSubmit(e) { e.preventDefault() const node = this.refs.input const inputText = node.value.trim() if (inputText) { this.mapInputToHandler(inputText) node.value = '' } }