From 6eeb2495bbfdda3da08103e793863d61f8631476 Mon Sep 17 00:00:00 2001 From: oasis-cloud Date: Tue, 26 Jul 2022 15:22:50 +0800 Subject: [PATCH] chore: v1.2.0 --- CHANGELOG.md | 32 +++++++++++++++++++ package.json | 2 +- src/packages/virtuallist/doc.md | 20 ++++++------ src/sites/doc/App.tsx | 2 +- .../components/demo-preview/demo-preview.tsx | 6 ++-- src/sites/doc/components/nav/nav.scss | 6 ++++ src/sites/doc/components/nav/nav.tsx | 2 +- src/sites/mobile/App.tsx | 22 +++++++++++-- src/sites/mobile/Links.tsx | 2 +- 9 files changed, 75 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a450026c..9a7547a2ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/package.json b/package.json index fd1ee9cb78..1125d969f0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/packages/virtuallist/doc.md b/src/packages/virtuallist/doc.md index 3462537784..323d53bc6b 100644 --- a/src/packages/virtuallist/doc.md +++ b/src/packages/virtuallist/doc.md @@ -198,16 +198,16 @@ export default App; ### Props -| 参数 | 说明 | 类型 | 默认值 | -|--------------|----------------------------------|--------|------------------| -| 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 | +| 参数 | 说明 | 类型 | 默认值 | +|---------------|----------------------------------|----------|---------------------------------------| +| 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 | 方法名 | 说明 | 参数 | 返回值 | | -------------- | ----------------------------- | --------------- | ---------- | diff --git a/src/sites/doc/App.tsx b/src/sites/doc/App.tsx index 1f0087ec22..9b9f64244a 100644 --- a/src/sites/doc/App.tsx +++ b/src/sites/doc/App.tsx @@ -127,7 +127,7 @@ const App = () => { return ( { 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 ( diff --git a/src/sites/doc/components/nav/nav.scss b/src/sites/doc/components/nav/nav.scss index 2246072c11..5b5cfc3e07 100644 --- a/src/sites/doc/components/nav/nav.scss +++ b/src/sites/doc/components/nav/nav.scss @@ -86,5 +86,11 @@ } } } + .selected { + color: #fa2c19 !important; + li { + color: #fa2c19 !important; + } + } } } diff --git a/src/sites/doc/components/nav/nav.tsx b/src/sites/doc/components/nav/nav.tsx index 7d440482cf..b37a5cb9c6 100644 --- a/src/sites/doc/components/nav/nav.tsx +++ b/src/sites/doc/components/nav/nav.tsx @@ -33,7 +33,7 @@ const Nav = () => {
  • {cp.name}  {cp.cName} diff --git a/src/sites/mobile/App.tsx b/src/sites/mobile/App.tsx index a487f3f3cf..b775ca7881 100644 --- a/src/sites/mobile/App.tsx +++ b/src/sites/mobile/App.tsx @@ -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 @@ -44,13 +44,29 @@ const WithNavRouter = (C: LoadableComponent) => { 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 ( <>
  • - + {com.name}