perf: perf excel comp code

This commit is contained in:
vben
2020-10-20 21:24:27 +08:00
parent 968f791f4b
commit eecde4c7e9
14 changed files with 144 additions and 183 deletions

View File

@@ -33,18 +33,7 @@ export default defineComponent({
props: basicProps,
emits: ['visible-change', 'ok', 'close', 'register'],
setup(props, { slots, emit, attrs }) {
// const { currentRoute } = useRouter();
const scrollRef = ref<any>(null);
// /**
// * @description: 获取配置ScrollContainer
// */
// const getScrollOptions = computed(
// (): ScrollContainerOptions => {
// return {
// ...(props.scrollOptions as any),
// };
// }
// );
const visibleRef = ref(false);
const propsRef = ref<Partial<DrawerProps> | null>(null);
@@ -85,7 +74,6 @@ export default defineComponent({
watch(
() => visibleRef.value,
(visible) => {
// appStore.commitLockMainScrollState(visible);
nextTick(() => {
emit('visible-change', visible);
});
@@ -95,27 +83,6 @@ export default defineComponent({
}
);
// function scrollBottom() {
// const scroll = unref(scrollRef);
// if (scroll) {
// scroll.scrollBottom();
// }
// }
// function scrollTo(to: number) {
// const scroll = unref(scrollRef);
// if (scroll) {
// scroll.scrollTo(to);
// }
// }
// function getScrollWrap() {
// const scroll = unref(scrollRef);
// if (scroll) {
// return scroll.getScrollWrap();
// }
// return null;
// }
// 取消事件
async function onClose(e: any) {
const { closeFunc } = unref(getProps);
@@ -219,12 +186,6 @@ export default defineComponent({
);
}
// const currentInstance = getCurrentInstance() as any;
// if (getCurrentInstance()) {
// currentInstance.scrollBottom = scrollBottom;
// currentInstance.scrollTo = scrollTo;
// currentInstance.getScrollWrap = getScrollWrap;
// }
const drawerInstance: DrawerInstance = {
setDrawerProps: setDrawerProps,
};
@@ -253,15 +214,6 @@ export default defineComponent({
class={[!unref(getProps).loading ? 'hidden' : '']}
tip="加载中..."
/>
{/* <ScrollContainer
ref={scrollRef}
{...{ ...attrs, ...unref(getScrollOptions) }}
style={{
height: `calc(100% - ${footerHeight})`,
}}
>
{() => getSlot(slots, 'default')}
</ScrollContainer> */}
<div
ref={scrollRef}
{...attrs}