V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
nmgwddj
V2EX  ›  React

如何在 MeteorJS 中优雅的使用 antd-mobile?

  •  
  •   nmgwddj · Sep 2, 2017 · 3098 views
    This topic created in 3169 days ago, the information mentioned may be changed or developed.

    在 meteor 中使用 antd 比较简单,但最近要做的一个项目是针对移动端的 web 项目,并非 react-native 的项目。很多 UI 设计都是移动端的风格,所以需要用到 antd-mobile。

    但使用 antd-mobile 过程中遇到了很多问题。因为 antd-mobile 中一写代码写死要依赖 react-native,所以没办法用下面这种方法导入组件。

    import { Button } from 'antd-mobile'
    

    后面从网上搜索得到了下面这种方法可以临时使用。

    import { Button } from 'antd-mobile/dist/antd-mobile.js'
    import 'antd-mobile/dist/antd-mobile.min.css'
    

    可以看到这里是直接把整个 antd-mobile.min.css 导入进去了,这样是可以显示界面的应用的,但能否做到像 antd 一样按需加载?而不是整个导入进去呢?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5947 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 03:35 · PVG 11:35 · LAX 20:35 · JFK 23:35
    ♥ Do have faith in what you're doing.