Giter Site home page Giter Site logo

suspend-button's People

Contributors

stupidmanyi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

suspend-button's Issues

优化css引入(使用css-module)

webpack.config.js处的css-loader配置更改为

{
 test: /\.(css)$/,
 use: ["style-loader", {
       loader: 'css-loader',
       options: {
          modules: true,
       }
  }],
}

src根目录下(注意不是examples的src根目录)新增global.d.ts文件,内容如下,这样tsx引入就不会报错了

declare module '*.css'

src/index.tsx中css引入方式更改为

import styles from './styles.css';

这个时候输出styles就会正确编译为module了
image
由于更改了css的使用方式,tsx中使用了className的地方需要做调整

// 大概65行处:
current.className = current.className + ` ${styles['suspend-button-ts-animate']}`;

// 大概186行处:
className={`${styles['suspend-button-ts']}`}

// 大概171行处
current.className = current.className + ` ${styles['suspend-button-ts-animate']}`;

脚手架可以使用vite、create-react-app

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.