LeeReamond
V2EX  ›  问与答

前端开发, vue3 的组件库 element+和 tailwindcss 是不是冲突?

  •  
  •   LeeReamond · Jul 30, 2022 · 2526 views
    This topic created in 1568 days ago, the information mentioned may be changed or developed.

    做个个人项目,想要用网上组件库的组件,有少部分不合适的想自己用 tailwind 做。

    现在环境是 npm+vite 装的 vue3-ts ,按官网的说明试了半天,怎么感觉装上 element+以后 tailwind 就不好使了,后装 tailwind 的话 element+又不好使了,这俩是不能一块用吗

    3 replies  •  2022-07-30 11:32:22 +08:00
    binhb
    binhb
    Jul 30, 2022
    1
    样式冲突了,tailwind 的 base 别引入
    jawilx
    jawilx
    Jul 30, 2022❤️1
    2
    naive-ui 里有提供解决方案,https://www.naiveui.com/zh-CN/os-theme/docs/style-conflict ,不知道 element-plus 有没有类似的方案,base 不引用的话很多样式会有问题
    dengshen
    dengshen
    Jul 30, 2022 via iPhone
    3
    引入顺序有问题。先引入 tailwin 在引入 element
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2222 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 02:10 · PVG 10:10 · LAX 18:10 · JFK 21:10
    ♥ Do have faith in what you're doing.