REACT_react使用antd-mobile UI框架

安装

npm install antd-mobile --save

public/index.html

<script src="https://as.alipayobjects.com/g/component/fastclick/1.0.6/fastclick.js"></script>
  <script>
    if ('addEventListener' in document) {
     
     
      document.addEventListener('DOMContentLoaded', function() {
     
     
        FastClick.attach(document.body);
      }, false);
    }
    if(!window.Promise) {
     
     
      document.writeln('<script src="https://as.alipayobjects.com/g/component/es6-promise/3.2.2/es6-promise.min.js"'+'>'+'<'+'/'+'script>');
    }
</script>

index.js

import 'antd-mobile/dist/antd-mobile.css';

使用

import {
    
     Button } from 'antd-mobile';

<Button type="primary">primary</Button>

猜你喜欢

转载自blog.csdn.net/weixin_44599931/article/details/118339632