SRC /动作/ index.js
import axios from 'axios';
const ROOT_URL = "http://localhost:3090";
export function signinUser({ email, password }){
return function(dispatch){
axios.post(`${ROOT_URL}/signin`, { email, password });
console.log("hey");
}
}
Run Code Online (Sandbox Code Playgroud)
SRC /组件/ AUTH
import React, { Component } from 'react';
import { reduxForm } from 'redux-form';
import * as actions from '../../actions';
class Signin extends Component {
handleFormSubmit({ email, password }){
this.props.signinUser({ email, password });
}
render() {
// code
console.log(actions)
const { handleSubmit, fields: { email,password } } = this.props;
return ( …Run Code Online (Sandbox Code Playgroud) 例如,对于给定的jquery片段,应该是等效的javascript.javascript中的等效添加方法可能会有所帮助.
$("h1").add("span").add("h2");
Run Code Online (Sandbox Code Playgroud)
正如jquery文档中明确提到的那样 - .add()不添加任何DOM元素.https://api.jquery.com/add/所以使用,.appendChild()不符合此目的