UI -- React

React 模板

React UI

  • package.json同级
  • components/slButton/element.jsx
import React from 'react';

const el = ({
     text, onClick }) => {
   
    return (
        <button onClick={
   onClick}>
            {
   text}
        </button>
    );
};

export default el;
  • components/function.js
export const ceshi = ()=>{
   
    console.log('123')
}
  • components/index.js
export {
    default as SlButton } from './slButton/element';
export {
   ceshi} from  './function'

使用

import  {
   SlButton,ceshi} from "../components/index"
function App() {
   
    const handleClick = ()=>{
   
        console.log("123")
        ceshi()
    }

    return (
        <>
            <SlButton text="Click me" onClick={
   handleClick} />
        </>
    );
}

export default App;

UI 文档

  • package.json 同级
  • docs 创建
npx create-dumi
# React Library react组件库
# npm start     运行
# 根据自己需要修改

相关推荐

  1. UI -- React

    2024-01-22 06:58:05       55 阅读
  2. React Material UI A Blogging Platform

    2024-01-22 06:58:05       30 阅读
  3. React Umi国际化配置

    2024-01-22 06:58:05       37 阅读
  4. Material-UI create-react-app 创建移动端 H5

    2024-01-22 06:58:05       32 阅读
  5. reactnative 调用原生UI组件(二),引入xml文件。

    2024-01-22 06:58:05       57 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-22 06:58:05       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-22 06:58:05       101 阅读
  3. 在Django里面运行非项目文件

    2024-01-22 06:58:05       82 阅读
  4. Python语言-面向对象

    2024-01-22 06:58:05       91 阅读

热门阅读

  1. 实现分布式锁:Zookeeper vs Redis

    2024-01-22 06:58:05       51 阅读
  2. web架构师编辑器内容-数据结构设计上面的难点

    2024-01-22 06:58:05       56 阅读
  3. Python 实现单例模式的几种方式以及存在的问题

    2024-01-22 06:58:05       59 阅读
  4. 【C++】特殊类设计

    2024-01-22 06:58:05       44 阅读
  5. 8-Docker网络命令之ls

    2024-01-22 06:58:05       54 阅读
  6. P8738 [蓝桥杯 2020 国 C] 天干地支

    2024-01-22 06:58:05       56 阅读
  7. 实时流媒体传输开源库——Live555

    2024-01-22 06:58:05       53 阅读