0.0.6 • Published 3 years ago

hasaui v0.0.6

Weekly downloads
18
License
MIT
Repository
github
Last release
3 years ago

hasaUI

目前封装了Button,Icons,dialog这三个组件。

项目施工中....应该是毕业设计....

体验

yarn add hasaui

导入

import { Icon, Button, Dialog } from 'hasaui'

// 像使用正常组件用就行,CSS建议使用styled-components

一个使用的例子

import React, { useState } from 'react'
import ReactDOM from 'react-dom'
import { Icon, Button, Dialog } from 'hasaui'
import styled from 'styled-components';


const App = () => {

    const [visible, setVisible] = useState(false);

    const changVisible = () => {
        setVisible(!visible);
    };

    const handleOk = () => {
        setVisible(!visible);
    };

    const MyButton = styled(Button)`
        // 这里必须要这么用, 否则无法覆盖组件的默认样式
        &&{
            background-color: purple;
        }
    `;

    return (
        <>
            <h1>H</h1>
            <Icon name="github" color="pink" width="2em" height="2em" />
            <MyButton onClick={changVisible}>点我查看dialog</MyButton>
            <Dialog visible={visible} onOk={handleOk}>
                <div>
                    我现在是一个提示,提示一些内容,给你看看
                </div>
            </Dialog>
        </>
    )
}

ReactDOM.render(
    <App />,
    document.getElementById('root')
)
0.0.6

3 years ago

0.0.5

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago