我想問一下要怎么才能使運行我的這個html頁面出結果?我運行了,但沒有結果//我的html頁面:<html><head>? <title>test demo</title></head><body>? <div id='a'></div>? <script ?type='text/javacript' ?src="nice.js">? </script></body></html>//我的js頁面:import React, {PropTypes} from "react";//重點是引用包是怎么回事?這樣引用了之后感覺沒用啊?這樣寫了代碼之后要怎么操作才會有作用?能幫忙詳細的解釋嗎?謝謝!import {browserHistory, Link} from 'react-router'import {Form, Button, Input} from "antd";const FormItem = Form.Item;function noop() {? ? return false;}const formItemLayout = {? ? labelCol: {span: 7},? ? wrapperCol: {span: 12},};class SigninForm extends React.Component {? ? static propTypes = {? ? ? ? history: PropTypes.object.isRequired? ? };? ? static defaultProps = {? ? ? ? formStyle: {? ? ? ? ? ? width: "450px",? ? ? ? ? ? height: "380px",? ? ? ? ? ? margin: "auto",? ? ? ? ? ? background: "fff",? ? ? ? ? ? paddingTop: "120px"? ? ? ? }? ? };? ? handleSubmit(e) {? ? ? ? e.preventDefault();? ? ? ? const value = this.props.form.getFieldsValue();? ? ? ? this.props.action.signin(value);? ? }? ? componentWillReceiveProps(nextProps) {? ? ? ? if (this.props.sign !== nextProps.sign) {?? ? ? ? ? ?const user = nextProps.sign.get('user');? ? ? ? ? ? if (user && user !== this.props.sign.get('user')) {? ? ? ? ? ? ? ? browserHistory.push('/console/')? ? ? ? ? ? } else if (nextProps.sign.has('signinError')) {? ? ? ? ? ? ? ? this.props.form.setFieldsValue({password: ''});? ? ? ? ? ? ? ? window.alert(nextProps.sign.getIn(['signinError', 'errMsg']));? ? ? ? ? ? }? ? ? ? }? ? }? ? render() {? ? ? ? const {getFieldDecorator} = this.props.form;? ? ? ? return (? ? ? ? ? ? <Form style={this.props.formStyle} horizontal onSubmit={this.handleSubmit.bind(this)}>? ? ? ? ? ? ? ? <FormItem? ? ? ? ? ? ? ? ? ? {...formItemLayout}? ? ? ? ? ? ? ? ? ? label="用戶名"? ? ? ? ? ? ? ? ? ? hasFeedback>? ? ? ? ? ? ? ? ? ? {getFieldDecorator('account', {})(? ? ? ? ? ? ? ? ? ? ? ? <Input />? ? ? ? ? ? ? ? ? ? )}? ? ? ? ? ? ? ? </FormItem>? ? ? ? ? ? ? ? <FormItem? ? ? ? ? ? ? ? ? ? {...formItemLayout}? ? ? ? ? ? ? ? ? ? label="密碼"? ? ? ? ? ? ? ? ? ? hasFeedback>? ? ? ? ? ? ? ? ? ? {getFieldDecorator('password', {? ? ? ? ? ? ? ? ? ? ? ? rules: [? ? ? ? ? ? ? ? ? ? ? ? ? ? {required: true, whitespace: true, message: '請填寫密碼'}? ? ? ? ? ? ? ? ? ? ? ? ],? ? ? ? ? ? ? ? ? ? })(? ? ? ? ? ? ? ? ? ? ? ? <Input type="password" autoComplete="off"? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?onContextMenu={noop} onPaste={noop} onCopy={noop} onCut={noop}/>? ? ? ? ? ? ? ? ? ? )}? ? ? ? ? ? ? ? </FormItem>? ? ? ? ? ? ? ? <FormItem wrapperCol={{span: 12, offset: 7}}>? ? ? ? ? ? ? ? ? ? <Button type="ghost"? ? ? ? ? ? ? ? ? ? ? ? ? ? onClick={e => browserHistory.push('/console/sign/signup')}>沒有創建?創建</Button> ? ? ? ? ? ? ? ? ? ? <Button type="primary" htmlType="submit">登錄</Button>? ? ? ? ? ? ? ? </FormItem>? ? ? ? ? ? </Form>? ? ? ? )? ? }}SigninForm = Form.create({})(SigninForm);export default SigninForm;
我想問一下這個代碼要怎么才能運行出結果出來?我想問的重點是引用包的那部分
慕碼人1183263
2016-11-08 11:05:53