Giter VIP home page Giter VIP logo

Comments (4)

mengsui avatar mengsui commented on June 11, 2024 2

目前我发现ProList里面引用的是CheckCard,CheckCard和Card引用的是同一个Actions组件。

Actions使用@ant-design/cssinjs的时候使用的组件的名字设置的useStyleRegister的path,但是我没有找到对应useStyleRegister对应的path参数的具体文档。

我测试了下,如果我把Actions的useStyle改为下面的代码是可以解决这个问题的。

export default function useStyle(prefixCls?: string) {
  return useAntdStyle(`ProCardActions${prefixCls}`, (token) => {
    const proCardActionsToken: ProCardActionsToken = {
      ...token,
      componentCls: `.${prefixCls}`,
      cardActionIconSize: 16,
    };

    return [genActionsStyle(proCardActionsToken)];
  });
}

如图:
image

我猜想prefixCls变化后组件名称没有变化导致缓存的值没更新。

from pro-components.

kaidouya avatar kaidouya commented on June 11, 2024

我也遇到跟你一样的问题
我是使用路由切换页面后下面action的樣式会跑掉
前提是上一个页面有使用ProList设置actions的组件
切换到下一个页面也是有使用ProList设置actions的组件,這时就会遗失样式,然後畫面重新整理就又恢復了,超詭異
还在找原因就刚好看到你的issue

from pro-components.

zhuba-Ahhh avatar zhuba-Ahhh commented on June 11, 2024

可以提个pr

from pro-components.

mengsui avatar mengsui commented on June 11, 2024

useAntdStyle是个通用方法,我这种写法破坏了规范,我暂时没有好的想法可以解决这个问题。

from pro-components.

Related Issues (20)

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.