Skip to content

Commit

Permalink
chore: v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud committed Jul 27, 2022
1 parent 21dcb5e commit 6eeb249
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 19 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## v1.2.0
`2022-07-27`

* :bug: fix: html title 文案修改 & button 组件 readme 格式修改 (#126)
* :zap: feat: 国际化语言支持 (#124)
* :zap: feat: add empty & review (#130)
* :bug: fix: 修复 button 组件 demo 中的错误文案 (#134)
* :zap: feat: cell 单元测试完成 (#132)
* :bug: fix: 修复 input 组件添加多语言支持后 placeholder 属性设置不生效的问题
* :bug: fix: fixednav 样式类名优化
* :bug: fix: 修改Button在服务端不渲染class和style (#133)
* :bug: fix: 修复自定义地址组件 (#143)
* :bug: fix: swiper问题修复 (#140)
* :bug: fix: 修复address组件三级地址切换回来二级地址不同步的问题 (#144)
* :bug: fix: dialog 组件多语言后props设置出错
* :zap: feat: 新增collapse组件的单元测试 (#145)
* :zap: feat: tag + switch 组件测试用例 (#148)
* :zap: feat: 新增虚拟列表virtuallist (#136)
* :zap: feat: indicator 组件 (#158)
* :bug: fix: textarea placeholder 设置不生效
* :bug: fix: textarea 组件 change、focus、blur 事件改为 onChange、onFocus、onBlur (#163)
* :zap: feat: popup在线文档接入和国际化支持 (#167)
* :zap: feat: navbar在线文档接入和国际化支持 (#171)
* :zap: feat: tabbar在线文档接入和国际化支持 (#169)
* :bug: fix: empty空状态组件新增国际化文档新增单元测试 (#164)
* :zap: feat: calendar在线文档接入和国际化支持 (#168)
* :zap: feat: indicator指示器组件新增国际化文档 (#166)
* :zap: feat: 弹框增加onClickSelf事件 (#172)
* :zap: feat: timeselect (#149)
* :zap: feat: divider组件新增props (#162)


## v1.1.4
`2022-05-23`

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nutui/nutui-react",
"version": "1.1.4",
"version": "1.2.0",
"style": "dist/style.css",
"main": "dist/nutui.react.umd.js",
"module": "dist/esm/nutui-react.es.js",
Expand Down
20 changes: 10 additions & 10 deletions src/packages/virtuallist/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@ export default App;

### Props

| 参数 | 说明 | 类型 | 默认值 |
|--------------|----------------------------------|--------|------------------|
| sourceData | 获取数据 | Array | - |
|containerSize | 容器高度 | Number|获取元素的offsetWidth或offsetHeight,需要css给出|
| ItemRender | virtual 列表父节点渲染的函数 | React.FC<any> | -|
| itemSize | item高度,如果不定高,则为首屏单个最大size | String | - |
| itemEqualSize | item大小是否一致 | Boolean | true |
| overscan |除了视窗里面默认的元素, 还需要额外渲染的item个数 | Number | 2 |
| key |唯一值 ,Item(sourceData)具体的某个唯一值的字段 | string | index |
| horizontal |决定列表是横向的还是纵向的 | Boolean | false |
| 参数 | 说明 | 类型 | 默认值 |
|---------------|----------------------------------|----------|---------------------------------------|
| sourceData | 获取数据 | Array | - |
| containerSize | 容器高度 | Number | 获取元素的offsetWidth或offsetHeight,需要css给出 |
| ItemRender | virtual 列表父节点渲染的函数 | React.FC | - |
| itemSize | item高度,如果不定高,则为首屏单个最大size | String | - |
| itemEqualSize | item大小是否一致 | Boolean | true |
| overscan | 除了视窗里面默认的元素, 还需要额外渲染的item个数 | Number | 2 |
| key | 唯一值 ,Item(sourceData)具体的某个唯一值的字段 | string | index |
| horizontal | 决定列表是横向的还是纵向的 | Boolean | false |
## Events
| 方法名 | 说明 | 参数 | 返回值 |
| -------------- | ----------------------------- | --------------- | ---------- |
Expand Down
2 changes: 1 addition & 1 deletion src/sites/doc/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const App = () => {
return (
<Route
key={Math.random()}
path={`${lang ? `/${lang}` : ''}/${ru}`}
path={`${lang ? `/${lang}` : ''}/component/${ru}`}
>
<ReactMarkdown
children={getMarkdownByLang(ru)}
Expand Down
6 changes: 4 additions & 2 deletions src/sites/doc/components/demo-preview/demo-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import { useHistory, useLocation } from 'react-router-dom'
const DemoPreview = (props: any) => {
const history = useHistory()
const location = useLocation()
const [URL, setURL] = useState(history.location.pathname)
const path = location.pathname.split('/')
const [URL, setURL] = useState(path[path.length - 1])

useEffect(() => {
setURL(location.pathname)
const path = location.pathname.split('/')
setURL(path[path.length - 1])
}, [location])

return (
Expand Down
6 changes: 6 additions & 0 deletions src/sites/doc/components/nav/nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,11 @@
}
}
}
.selected {
color: #fa2c19 !important;
li {
color: #fa2c19 !important;
}
}
}
}
2 changes: 1 addition & 1 deletion src/sites/doc/components/nav/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Nav = () => {
<NavLink
key={Math.random()}
activeClassName="selected"
to={`${lang ? `/${lang}` : ''}/${cp.name}`}
to={`${lang ? `/${lang}` : ''}/component/${cp.name}`}
>
<li>
{cp.name}&nbsp;&nbsp;<b>{cp.cName}</b>
Expand Down
22 changes: 19 additions & 3 deletions src/sites/mobile/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import zhCN from '@/locales/zh-CN'
import enUS from '@/locales/en-US'
import { BaseLang } from '@/locales/base'
import Icon from '@/packages/Icon'
import config from '@/sites/config/env'
import { nav } from '@/config.json'

interface Languages {
[key: string]: BaseLang
Expand All @@ -44,13 +44,29 @@ const WithNavRouter = (C: LoadableComponent<any>) => {
location.href = href
}
const pathNames = props.location.pathname.split('/')
const getComponentName = () => {
const s = window.location.hash.split('/')
const cname = s[s.length - 1].toLowerCase()
const component: any = {}
nav.forEach((item: any) => {
item.packages.forEach((sItem: any) => {
if (sItem.name.toLowerCase() == cname) {
component.name = sItem.name
component.cName = sItem.cName
return
}
})
})
return component
}
console.log(getComponentName())
return (
<>
<div id="nav">
<div className="back" onClick={() => window.parent.history.back()}>
<Icon name="left"></Icon>
</div>
{pathNames[pathNames.length - 1]}
{getComponentName()['name']}
<div className="translate" onClick={() => handleSwitchLocale()}>
<Icon name="https://img14.360buyimg.com/imagetools/jfs/t1/135168/8/21387/6193/625fa81aEe07cc347/55ad5bc2580c53a6.png"></Icon>
</div>
Expand Down Expand Up @@ -89,7 +105,7 @@ const AppSwitch = () => {
return (
<Route
key={Math.random()}
path={`${locale ? `/${locale}` : ''}${item.path}`}
path={`${item.path}`}
component={WithNavRouter(C)}
/>
)
Expand Down
2 changes: 1 addition & 1 deletion src/sites/mobile/Links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Links = () => {
{nav.packages.map((com) =>
com.show ? (
<li key={com.name}>
<Link key={com.name} to={`${lang}/${com.name}`}>
<Link key={com.name} to={`${com.name}`}>
{com.name}
</Link>
</li>
Expand Down

0 comments on commit 6eeb249

Please sign in to comment.