1 | import { computed, inject, provide } from 'vue';
|
2 |
|
3 | function noop() {}
|
4 |
|
5 | export var AnchorContextKey = Symbol('anchorContextKey');
|
6 |
|
7 | var useProvideAnchor = function useProvideAnchor(state) {
|
8 | provide(AnchorContextKey, state);
|
9 | };
|
10 |
|
11 | var useInjectAnchor = function useInjectAnchor() {
|
12 | return inject(AnchorContextKey, {
|
13 | registerLink: noop,
|
14 | unregisterLink: noop,
|
15 | scrollTo: noop,
|
16 | activeLink: computed(function () {
|
17 | return '';
|
18 | }),
|
19 | handleClick: noop
|
20 | });
|
21 | };
|
22 |
|
23 | export { useInjectAnchor, useProvideAnchor };
|
24 | export default useProvideAnchor; |
\ | No newline at end of file |