2.0.2 • Published 3 years ago

@parrotjs/classnames v2.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

一、支持环境

二、node环境使用 (已通过测试√)

三、浏览器环境使用

1.HTML中使用 (已通过测试√)

//使用upk在线cdn
//需要搭配which-type判断类型
<script src="https://unpkg.com/@parrotjs/which-type@1.5.0/index.js"></script>

<script src="https://unpkg.com/@parrotjs/classnames@1.0.0/index.js"></script>
//使用jsdelivr在线cdn
<script src="https://cdn.jsdelivr.net/npm/@parrotjs/which-type@1.5.0/index.js"></script>

<script src="https://cdn.jsdelivr.net/npm/@parrotjs/classnames@1.0.0/index.js"></script>
//index.html
<!DOCTYPE html>
<html>
    <head></head>
    <body>
        <script src="https://unpkg.com/@parrotjs/which-type@1.5.0/index.js"></script>
        <script src="https://unpkg.com/@parrotjs/classnames@1.0.0/index.js"></script>
        <script>
           console.log(classNames("name",{"a":true,"b":false}))
        </script>
    </body>
</html>

2.ESM中使用 (已通过测试√)

四、github源码地址

https://github.com/parrot-design/parrot-utils/tree/main/classnames

五、版本变更记录

  • 1.0.0 初始化目录

六、使用场景

合并多个class,在组件库场景下常被使用