Skip to content

Commit

Permalink
完成项目初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
zayyo123 committed Aug 14, 2023
1 parent 09d2da1 commit 2f3c90a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion vite-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"build": "tsc && vite build",
"preview": "vite preview",
"prettier": "prettier --write .",
"lint": "eslint ."
"lint": "eslint .",
"prepare": "husky install"
},
"dependencies": {
"@ant-design/icons": "^5.2.5",
Expand Down
3 changes: 1 addition & 2 deletions vite-react/src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { configureStore } from '@reduxjs/toolkit'
// 初始化数据
const initialState = {
name: 'zayyo',
age: 18,
sex: '男'

}
// Reducer:定义如何更新状态
const rootReducer = (state = initialState, action: any) => {
Expand Down
2 changes: 2 additions & 0 deletions vite-react/src/views/home/Component/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { memo } from 'react'
import type { ReactNode, FC } from 'react'
import { useSelector } from 'react-redux'
import { Button } from 'antd'

interface IProps {
children?: ReactNode
Expand All @@ -17,6 +18,7 @@ const Home: FC<IProps> = () => {
<div>
我是home页
<div>{data}</div>
<Button type="primary">Button</Button>
</div>
)
}
Expand Down

0 comments on commit 2f3c90a

Please sign in to comment.