Skip to content

Commit 0af29f8

Browse files
committed
调整打印的padding和readme
1 parent 3cf4faf commit 0af29f8

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

README.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
# 这是简历编辑器
22

3-
这是通过 reactreact-hooks、typecript、sass 搭建的简历编辑器(demo)
3+
这是通过 **react****react-hooks、redux、typecript、sass(module)** 搭建的简易版简历编辑器(demo)
44

5-
## `yarn install`
5+
## 目前实现的主要功能
66

7-
## `yarn start`
7+
- 支持通过编辑栏输入信息,预览栏可显示
8+
- 简单的表单验证
9+
- 支持 markdown 语法,在头部栏右边的设置按钮处打开
10+
- 支持打印和导出 pdf(预览栏右上方点击下载)
811

9-
## `yarn build`
12+
## 安装方式
13+
14+
- `yarn install`
15+
16+
- `yarn start`
17+
18+
- `yarn build`

src/assets/index.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ body,
8888
background-color: #ffffff;
8989
}
9090
.print-content {
91-
padding: 0 40px 0 40px;
91+
padding: 0 50px 0 50px;
9292
}
9393
}
9494

src/components/common/container-md/index.tsx

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { memo, useContext } from 'react'
22
import MarkDown from 'markdown-to-jsx'
3-
import {ShowMarkdown} from 'src/layout/index'
3+
import { ShowMarkdown } from 'src/layout/index'
44

55
import styles from './style.module.scss'
66

@@ -10,15 +10,13 @@ interface ListContainerProps {
1010

1111
const ContainerMd = ({ content }: ListContainerProps) => {
1212
const useMarkdown = useContext(ShowMarkdown)
13-
console.log(useMarkdown, ';cc')
1413
return (
1514
<div className={styles['list-container']}>
16-
17-
{
18-
useMarkdown === '1' ?
19-
<MarkDown>{content}</MarkDown> :
20-
<div className={styles['linebreak']}>{content}</div>
21-
}
15+
{useMarkdown === '1' ? (
16+
<MarkDown>{content}</MarkDown>
17+
) : (
18+
<div className={styles['linebreak']}>{content}</div>
19+
)}
2220
</div>
2321
)
2422
}

src/components/common/list-item-header/index.tsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { Fragment, memo } from 'react'
22

33
import MySvg from 'src/components/svg'
44
import styles from './style.module.scss'
5+
import ContainerMd from 'src/components/common/container-md'
56

67
interface HeaderProps {
78
headerData: any
@@ -15,17 +16,21 @@ const handleArr = function (item: string | string[]) {
1516
if (Object.prototype.toString.call(item) === '[object Array]') {
1617
return item.join(' - ')
1718
}
19+
return ''
1820
}
1921

2022
const ListItemHeader = ({ headerData, icon }: HeaderProps) => {
2123
return (
2224
<div className={styles['list-item-header']}>
23-
{Object.keys(headerData).map((key: any, index: number) => (
24-
<Fragment key={key}>
25-
{index === 0 && icon && <MySvg iconName={icon} />}
26-
<span>{handleArr(headerData[key])}</span>
27-
</Fragment>
28-
))}
25+
{Object.keys(headerData)
26+
.reverse()
27+
.map((key: any, index: number) => (
28+
<Fragment key={key}>
29+
{index === 0 && icon && <MySvg iconName={icon} />}
30+
{/* <span>{handleArr(headerData[key])}</span> */}
31+
<ContainerMd content={handleArr(headerData[key])} />
32+
</Fragment>
33+
))}
2934
</div>
3035
)
3136
}

0 commit comments

Comments
 (0)