Coder Social home page Coder Social logo

jdf2e / nutui-react Goto Github PK

View Code? Open in Web Editor NEW
808.0 16.0 243.0 41.23 MB

京东风格的移动端 React 组件库 、支持多端小程序(A React UI Toolkit for Mobile Web)

Home Page: https://nutui.jd.com/react/

JavaScript 3.45% Shell 0.01% HTML 5.16% SCSS 11.25% TypeScript 79.27% CSS 0.86%
typescript react-components ui-library ui-kit nutui-react

nutui-react's Introduction

logo

JD-style mobile UI components based on React that support users to develop H5 and mini-programs.

PRs Welcome license GitHub contributors GitHub Release Date GitHub commit activity

NutUI-React   NutUI-React


Nut[nʌt]: the one Squirrel Scrat pursues resolutely for a lifetime and will never let go even if it causes a catastrophe from the animated film Ice Age.

简体中文 | English

Features

  • 🚀 70+ High Quality Components
  • 📖 Based on JD APP 11.0 Visual Specifications
  • 🍭 Support Tree Shaking
  • 📖 Extensive Documentation and Demos
  • 💪 Written in TypeScript
  • 💪 Support SSR (Experimental)
  • 🍭 Support Custom Themes
  • 🍭 90%+ Unit Test Coverage
  • 📖 Provide Sketch Design Resources

Running locally

running with H5

# Clone repository
git clone https://github.com/jdf2e/nutui-react.git

# Enter the project dictionary
cd nutui-react

# Install dependencies
pnpm install

# Start development
pnpm run dev

# visit in browser: http:http://localhost:3000 (you don't have to open it manually if you've run it in the browser again)

running with mini-program

# Clone repository
git clone https://github.com/jdf2e/nutui-react.git

# Enter the project dictionary
cd nutui-react

# Install dependencies
pnpm install

# Start development
# dir:src/sites/mobile-taro/dist/weapp
pnpm run dev:taro:weapp

# OR run as jd mini-program
# dir:src/sites/mobile-taro/dist/jd
pnpm run dev:taro:jd

Build Versions

If you are using AMD environment or build tools such as Webpack, Vite, etc., we recommend using the es version. If it is a non-module environment (such as direct reference through the <script> tag), it is recommended to use the umd compressed version.

  • es nutui.es.js

  • umd nutui.umd.js

Links

Communication

Version WeChat Group JD Dongdong Group
NutUI React Reply 「NutUI-React」 after following 1025679314
NutUI x Taro Reply 「NutUI-React」 after following 1022545110

Join Us

NutUI Community

Welcome To NutUI-React Community

Contribute to NutUI

There are some choices of contributing to NutUI as follows, solving issues, fixing bugs, adding new components, i18n, UI customization, platform and cross-end adaptation, etc.

You are very welcome to contribute code to NutUI. Before your pull requests, please read NutUI Developer Contributing Guide

Issue & Discussion

Report issues to NutUI

It is highly recommended to read [How To Ask Questions The Smart Way](https://github.com/ryanhanwu/, How To Ask Questions Of GitHub Community and How to Report Bugs Effectively, then you can get understanding and help more easily.

NutUI Discussion

If you have any ideas, questions or suggestions, you can share your opinions here.

Contributors

Thanks to all the following developers。 who have contributed code to NutUI.

contributors

Stargazers

Stargazers repo roster for @jdf2e/nutui-react

Forkers

Forkers repo roster for @jdf2e/nutui-react

Milestones

Milestones

Release Notes

NutUI follows Angular Style Commit Message Conventions. The up-to-date release notes are available on Release

Open Source License

This project is based on MIT protocol

nutui-react's People

Contributors

836334258 avatar ailululu avatar alex-huxiyang avatar anteehub avatar drjingfubo avatar dushoujun avatar eiinu avatar irissong avatar ivan-my avatar junjun666 avatar kasonyang avatar kurisu994 avatar libin0824 avatar lkjh3214 avatar midday avatar oasis-cloud avatar onlyling avatar renovate[bot] avatar richard1015 avatar simplystyle avatar snandy avatar szg2008 avatar vickyye avatar xiaoyatong avatar yangjinjun3 avatar yangxiaolu1993 avatar yeyu98 avatar ymm0008 avatar zhehu1 avatar zhenyulei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nutui-react's Issues

支持taro

我看vue版本是支持taro的,react版本后期会支持taro吗

react nutui component textarea bind Value not work

example:
const [content, setContent] = useState('')

<TextArea className='textarea' defaultValue={content} onChange={(e) => { console.log('e', e) }} limitShow maxlength='20' /> change value 123 console.log('content', content) => ''

根据条件动态渲染不同页面时出现页面不停刷新 抖动的情况

不确定是不是我自己的开发问题,因为刚开始学习和使用react四天时间,还有些生疏,问题是这样的
在渲染列表页的时候,根据不同的情况,如果列表没有数据,则渲染,否则渲染正常的
在return()里使用了{!bool && } ,bool = useState, MyEmpty自定义,{bool&&},同样MyCard自定义,
此时在 MyCard 里面有一个 元素,例如,在获取change事件后,更新 useState时,会不停的重新渲染整个页面,此时页面会出现抖动的情况,如果将MyCard里的元素全部直接写到return()里,则不会出现此情况。
问题就是这样,感谢大佬们的支持。

官网 babel 按需加载例子缺少 引入 sass varibale

问题

nutui-react 官网「快速上手」一节介绍 WebPack 构建工具 通过 babel 使用按需加载 有误
仅配置 babel-plugin-import 无法正常运行

报错如下

Failed to compile.

SassError: Undefined variable.
  ╷
5 │   width: $icon-width;
  │          ^^^^^^^^^^^
  ╵
  node_modules/@nutui/nutui-react/dist/packages/icon/icon.scss 5:10  root stylesheet
ERROR in ./node_modules/@nutui/nutui-react/dist/packages/icon/icon.scss (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[2]!./node_modules/resolve-url-loader/index.js??ruleSet[1].rules[1].oneOf[7].use[3]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[4]!./node_modules/@nutui/nutui-react/dist/packages/icon/icon.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
  ╷
5 │   width: $icon-width;
  │          ^^^^^^^^^^^
  ╵
  node_modules/@nutui/nutui-react/dist/packages/icon/icon.scss 5:10  root stylesheet

后续发现,@nutui/nutui-react 导出的 sass 文件包含 sass variable 但是未引入对应 sass variable 文件,实际配置还需要借助 sass-resources-loader 全局导入 sass variable 文件

可复现demo

https://stackblitz.com/edit/webpack-webpack-js-org-bmddyc

Infiniteloading里的loadMore方法,当props更新的时候,loadMore方法取不到最新的props值,需要第二次执行才能取到。

const refreshLoadMore = (done: () => void) => {
setTimeout(() => {
const { newValue } = props; // 假设这个newValue 是该父组件传过来的值,且中途有修改。则需要执行到第二次refreshLoadMore ,newValue 才能取到修改之后的值
const curLen = refreshList.length
for (let i = curLen; i < curLen + 10; i++) {
refreshList.push(${i})
}
if (refreshList.length >= 30) {
setRefreshHasMore(false)
} else {
setRefreshList([...refreshList])
}
done()
}, 500)
}

Calendar 开始时间无效

Calendar 开始时间无效

packages.json
image

代码:
image

结果:(无法向上滚动,查看更多数据)
image

npm run dev 时报错

npm run dev 时报错

Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2019", "firefox78", "safari13.1")

image

dialog弹窗组件希望增加点击弹窗本身抛出事件

dialog弹窗组件希望增加点击弹窗本身抛出事件

`<Dialog
title="组件调用"
visible={visible1}
onOk={() => setVisible1(false)}
onCancel={() => setVisible1(false)}
onClick={()=>{}}

如果需要在弹窗内嵌入组件或其他自定义内容,可以使用组件调用的方式。
`

希望每个组件的Props类型能export出去

在原组件上进行业务组件开发时,需要继承原组件的props类型,没法直接通过
import { Icon, IconProps } from '@nutui/nutui-react'

目前只能通过

type IconProps = typeof Icon.defaultProps

这样不友好的方便来获取,感觉代码不够美观

Popup 组件体验问题

  1. 没有设置最大宽度/高度
  2. 调整x号样式,需要修改的属性太多,建议优化。

Upload 上传非图片格式时期望增加自定义图片的配置

Upload 默认使用时(非自定义)如果上传非图片格式,显示一片空白,查看源码,只有上传图片才显示img标签。

期望上传 pdf/word/ppt 等格式的文件时,能自定义配置要展示的默认图片,需要暴漏出一个 props。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.