fix: anchor provide not work
parent
c0adff7695
commit
8b4c55c75f
|
@ -1,4 +1,4 @@
|
|||
import { inject } from 'vue';
|
||||
import { inject, provide } from 'vue';
|
||||
import PropTypes from '../_util/vue-types';
|
||||
import classNames from 'classnames';
|
||||
import addEventListener from '../vc-util/Dom/addEventListener';
|
||||
|
@ -99,11 +99,6 @@ export default {
|
|||
showInkInFixed: false,
|
||||
getContainer: getDefaultContainer,
|
||||
}),
|
||||
setup() {
|
||||
return {
|
||||
configProvider: inject('configProvider', ConfigConsumerProps),
|
||||
};
|
||||
},
|
||||
data() {
|
||||
this.links = [];
|
||||
this._sPrefixCls = '';
|
||||
|
@ -111,9 +106,8 @@ export default {
|
|||
activeLink: null,
|
||||
};
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
antAnchor: {
|
||||
created() {
|
||||
provide('antAnchor', {
|
||||
registerLink: link => {
|
||||
if (!this.links.includes(link)) {
|
||||
this.links.push(link);
|
||||
|
@ -127,11 +121,14 @@ export default {
|
|||
},
|
||||
$data: this.$data,
|
||||
scrollTo: this.handleScrollTo,
|
||||
});
|
||||
provide('antAnchorContext', this);
|
||||
},
|
||||
antAnchorContext: this,
|
||||
setup() {
|
||||
return {
|
||||
configProvider: inject('configProvider', ConfigConsumerProps),
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
const { getContainer } = this;
|
||||
|
|
Loading…
Reference in New Issue