diff --git a/antdv-demo b/antdv-demo index 7875c8b3e..1fcb6d17a 160000 --- a/antdv-demo +++ b/antdv-demo @@ -1 +1 @@ -Subproject commit 7875c8b3e46c0162afc28f884aca418de72c3534 +Subproject commit 1fcb6d17a15cccb3ce44539a1bbf9612e74933cd diff --git a/components/anchor/Anchor.jsx b/components/anchor/Anchor.jsx index acd05c50c..b24a6300c 100644 --- a/components/anchor/Anchor.jsx +++ b/components/anchor/Anchor.jsx @@ -281,7 +281,7 @@ export default { visible: activeLink, }); - const wrapperClass = classNames(this.wrapperClass, `${prefixCls}-wrapper`); + const wrapperClass = classNames(this.$attrs.class, this.wrapperClass, `${prefixCls}-wrapper`); const anchorClass = classNames(prefixCls, { fixed: !affix && !showInkInFixed, @@ -290,6 +290,7 @@ export default { const wrapperStyle = { maxHeight: offsetTop ? `calc(100vh - ${offsetTop}px)` : '100vh', ...this.wrapperStyle, + ...this.$attrs.style, }; const anchorContent = ( diff --git a/components/anchor/AnchorLink.jsx b/components/anchor/AnchorLink.jsx index 1a7e8bdcf..f80ba5f9b 100644 --- a/components/anchor/AnchorLink.jsx +++ b/components/anchor/AnchorLink.jsx @@ -3,6 +3,7 @@ import PropTypes from '../_util/vue-types'; import { initDefaultProps, getComponent } from '../_util/props-util'; import classNames from 'classnames'; import { ConfigConsumerProps } from '../config-provider'; +function noop() {} export const AnchorLinkProps = { prefixCls: PropTypes.string, @@ -18,7 +19,11 @@ export default { }), setup() { return { - antAnchor: inject('antAnchor', {}), + antAnchor: inject('antAnchor', { + registerLink: noop, + unregisterLink: noop, + scrollTo: noop, + }), antAnchorContext: inject('antAnchorContext', {}), configProvider: inject('configProvider', ConfigConsumerProps), }; @@ -57,7 +62,7 @@ export default { const prefixCls = getPrefixCls('anchor', customizePrefixCls); const title = getComponent(this, 'title'); - const active = this.antAnchor.$data.activeLink === href; + const active = this.antAnchor.activeLink === href; const wrapperClassName = classNames(`${prefixCls}-link`, { [`${prefixCls}-link-active`]: active, }); diff --git a/components/card/__tests__/__snapshots__/demo.test.js.snap b/components/card/__tests__/__snapshots__/demo.test.js.snap index 53f4e8b97..091e50dc8 100644 --- a/components/card/__tests__/__snapshots__/demo.test.js.snap +++ b/components/card/__tests__/__snapshots__/demo.test.js.snap @@ -310,7 +310,7 @@ exports[`renders ./antdv-demo/docs/card/demo/tabs.md correctly 1`] = `
-
+
@@ -353,7 +353,7 @@ exports[`renders ./antdv-demo/docs/card/demo/tabs.md correctly 1`] = `
-
+