perf(modal-drawer): replace the scrollbar assembly

This commit is contained in:
vben
2020-12-28 00:16:17 +08:00
parent 73cee06daa
commit ebf7c8aa53
41 changed files with 1100 additions and 874 deletions

View File

@@ -1,5 +1,5 @@
import { getCurrentInstance, reactive, shallowRef, watchEffect } from 'vue';
import type { Ref } from 'vue';
interface Params {
excludeListeners?: boolean;
excludeKeys?: string[];
@@ -12,7 +12,7 @@ export function entries<T>(obj: Hash<T>): [string, T][] {
return Object.keys(obj).map((key: string) => [key, obj[key]]);
}
export function useAttrs(params: Params = {}) {
export function useAttrs(params: Params = {}): Ref<Recordable> | {} {
const instance = getCurrentInstance();
if (!instance) return {};