Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Punk-and-The-Monk committed Aug 10, 2020
1 parent 76acfe2 commit 81f668f
Show file tree
Hide file tree
Showing 11 changed files with 3,387 additions and 32 deletions.
Binary file not shown.
71 changes: 48 additions & 23 deletions react-jianshu/src/pages/detail/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
import React, { PureComponent } from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom'
import { actionCreators } from './store'
import {
/*
* @Author: LinFeng
* @LastEditors: LinFeng
* @Date: 2020-07-09 17:34:28
* @LastEditTime: 2020-07-25 21:22:31
* @FilePath: /frontend-starter/react-jianshu/src/pages/detail/index.js
* @Description:
*/
import React, {
PureComponent
} from 'react';
import {
connect
} from 'react-redux';
import {
withRouter
} from 'react-router-dom'
import {
actionCreators
} from './store'
import {
DetailWrapper,
Header,
Content
Expand All @@ -15,31 +31,40 @@ class Detail extends PureComponent {
}

render() {
const { title, content } = this.props
const {
title,
content
} = this.props

return (
<DetailWrapper>
<Header>
{title}
</Header>
<Content
dangerouslySetInnerHTML={{
__html: content
}}
>
</Content>
</DetailWrapper>
return ( <
DetailWrapper >
<
Header > {
title
} <
/Header> <
Content dangerouslySetInnerHTML = {
{
__html: content
}
} >
<
/Content> < /
DetailWrapper >
)
}
}

const mapState = (state) => ({
title: state.getIn(['detail', 'title']),
content: state.getIn(['detail', 'content'])
})
const mapState = (state) => {
console.log(state)
return {
title: state.getIn(['detail', 'title']),
content: state.getIn(['detail', 'content'])
}
}

const mapDispatch = (dispatch) => ({
getDetail(id){
getDetail(id) {
dispatch(actionCreators.getDetail(id))
}
})
Expand Down
7 changes: 5 additions & 2 deletions webpack-react-scaffolding/build/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @Author: LinFeng
* @LastEditors: LinFeng
* @Date: 2020-07-24 18:36:42
* @LastEditTime: 2020-07-25 09:57:47
* @FilePath: /webpack-react-scaffolding/build/webpack.common.js
* @LastEditTime: 2020-07-25 11:58:30
* @FilePath: /frontend-starter/webpack-react-scaffolding/build/webpack.common.js
* @Description:
*/
const path = require('path');
Expand All @@ -18,6 +18,9 @@ module.exports = {
module: {
rules:[]
},
resolve: {
extensions: ['.jsx', '.js']
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(srcPath, 'index.html'),
Expand Down
1 change: 1 addition & 0 deletions webpack-react-scaffolding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"react-redux": "^7.2.0",
"react-router-dom": "^5.2.0",
"redux": "^4.0.5",
"redux-immutable": "^4.0.0",
"redux-thunk": "^2.3.0",
"styled-components": "^5.1.1"
}
Expand Down
24 changes: 17 additions & 7 deletions webpack-react-scaffolding/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,32 @@
* @Author: LinFeng
* @LastEditors: LinFeng
* @Date: 2020-07-24 19:18:11
* @LastEditTime: 2020-07-25 08:59:29
* @FilePath: /webpack-react-scaffolding/src/App.jsx
* @LastEditTime: 2020-07-25 11:59:18
* @FilePath: /frontend-starter/webpack-react-scaffolding/src/App.jsx
* @Description: entry
*/
import React from 'react';
import React, { Fragment } from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'
import { BrowserRouter as Router, Route } from 'react-router-dom'
import store from './store'

class App extends React.Component{
render(){
class App extends React.Component {

render() {
return (
<div>the punk and the monk</div>
<Fragment>
<Provider store={store}>
<Router>
<div>aaa</div>
</Router>
</Provider>
</Fragment>
)
}
}

ReactDOM.render(
<App />,
document.getElementById('root')
)
)
5 changes: 5 additions & 0 deletions webpack-react-scaffolding/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5357,6 +5357,11 @@ readdirp@~3.4.0:
dependencies:
picomatch "^2.2.1"

redux-immutable@^4.0.0:
version "4.0.0"
resolved "https://registry.npm.taobao.org/redux-immutable/download/redux-immutable-4.0.0.tgz#3a1a32df66366462b63691f0e1dc35e472bbc9f3"
integrity sha1-Ohoy32Y2ZGK2NpHw4dw15HK7yfM=

redux-thunk@^2.3.0:
version "2.3.0"
resolved "https://registry.npm.taobao.org/redux-thunk/download/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 面试准备/学习记录.assets/粘性布局.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 81f668f

Please sign in to comment.