chore: rename rootRef to root

This commit is contained in:
chenjiahan
2020-09-15 19:32:45 +08:00
parent b0ca6a997b
commit 1e7e7086d6
11 changed files with 46 additions and 49 deletions

View File

@@ -36,10 +36,10 @@ export default createComponent({
setup(props, { slots }) {
const offset = ref(0);
const barRef = ref();
const rootRef = ref();
const root = ref();
const children = reactive([]);
const scrollParent = useScrollParent(rootRef);
const scrollParent = useScrollParent(root);
const opened = computed(() =>
children.some((item) => item.state.showWrapper)
@@ -120,12 +120,12 @@ export default createComponent({
provide(DROPDOWN_KEY, { props, offset, children });
useClickAway(rootRef, onClickAway);
useClickAway(root, onClickAway);
useEventListener('scroll', onScroll, { target: scrollParent });
return () => (
<div ref={rootRef} class={bem()}>
<div ref={root} class={bem()}>
<div
ref={barRef}
style={barStyle.value}