Skip to content

a-image-preview-group previewPrefixCls undefined Image preview component style undefined #4231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task
cjSound opened this issue Jun 19, 2021 · 1 comment
Closed
1 task
Labels

Comments

@cjSound
Copy link

cjSound commented Jun 19, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.2.0-beta.3

Environment

vue:3.1.1

Reproduction link

Edit on CodeSandbox

Steps to reproduce

图片预览 class丢失了prefixCls前缀,全为undefined

What is expected?

class显示完整 样式展示正确

What is actually happening?

  • 节点class 前缀全为undefined
  • 查看源码 vue3.1.1版本 a-image-preview-group 组件 props.previewPrefixCls 默认 为 undefined,并且props属性对configProvider的属性进行覆盖,导致后续样式全部失效
// a-image-preview-group组件
var getPrefixCls = configProvider.getPrefixCls;
      var prefixCls = getPrefixCls('image-preview', props.previewPrefixCls);
      return (0, _vue.createVNode)(_PreviewGroup.default, _objectSpread({
        "previewPrefixCls": prefixCls
      }, _extends(_extends({}, attrs), props)), slots);
  • image 该属性正常,写法上存在差异,此处写法是默认configProvider 覆盖了props属性
// image组件
setup: function setup(props, ctx) {
    var slots = ctx.slots,
        attrs = ctx.attrs;
    var configProvider = (0, _vue.inject)('configProvider', _configProvider.defaultConfigProvider);
    return function () {
      var getPrefixCls = configProvider.getPrefixCls;
      var prefixCls = getPrefixCls('image', props.prefixCls);
      return (0, _vue.createVNode)(_vcImage.default, _extends(_extends(_extends({}, attrs), props), {
        prefixCls: prefixCls
      }), slots);
    };
  }
@github-actions github-actions bot changed the title a-image-preview-group previewPrefixCls undefined 图片预览组件 样式undefined a-image-preview-group previewPrefixCls undefined Image preview component style undefined Jun 19, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants