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

vue3 deep 写法问题

  •  
  •   PEax · Mar 29, 2022 · 1863 views
    This topic created in 1502 days ago, the information mentioned may be changed or developed.

    vue2 deep 可以只写一个,比如 ::v-deep { .a{} .b{} }

    vue3 这样写报了警告 [@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.

    意思就是需要写成 ::deep(.a) {} ::deep(.b) {}

    但是现在我重新的样式比较多,有没有办法只写一个?

    4 replies    2022-03-29 21:59:57 +08:00
    gadfly3173
        1
    gadfly3173  
       Mar 29, 2022
    给他们的父级加:deep()就行了
    mxT52CRuqR6o5
        2
    mxT52CRuqR6o5  
       Mar 29, 2022 via Android
    把::v-deep { }改成:deep { }试试
    codeisjobs
        3
    codeisjobs  
       Mar 29, 2022 via Android
    /deep/.classname {} 这样就行
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2760 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 15:38 · PVG 23:38 · LAX 08:38 · JFK 11:38
    ♥ Do have faith in what you're doing.