Skip to content

Commit

Permalink
fix: fix window npm script
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Oct 16, 2020
1 parent b84de1a commit a0b09e7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
jsx: true,
},
},

Expand Down
2 changes: 1 addition & 1 deletion build/script/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const runPreview = async () => {
});
const { type } = await prompt;
if (type === BUILD) {
runBuild();
await runBuild();
}
startApp();
};
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
"serve": "cross-env ts-node --files -P ./build/tsconfig.json ./build/script/preserve && cross-env NODE_ENV=development vite",
"build": "node ./build/jsc.ts build",
"build:site": "cross-env SITE=true npm run build ",
"build:no-cache": "yarn clean:cache && npm run build",
"build:no-cache": "yarn clean:cache && node ./build/jsc.ts build",
"report": "cross-env REPORT=true npm run build ",
"preview": "node ./build/jsc.ts preview",
"log": "node ./build/jsc.ts log",
"gen:gz": "node ./build/jsc.ts gzip",
"clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite_opt_cache",
"clean:lib": "npx rimraf node_modules",
"ls-lint": "npx ls-lint",
Expand Down
13 changes: 9 additions & 4 deletions src/components/Container/src/collapse/CollapseContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<CollapseTransition :enable="canExpan">
<Skeleton v-if="loading" />
<div class="collapse-container__body" v-else v-show="show">
<LazyContainer :timeout="lazyTime" v-if="lazy">
<!-- <LazyContainer :timeout="lazyTime" v-if="lazy">
<slot />
<template #skeleton>
<slot name="lazySkeleton" />
</template>
</LazyContainer>
</LazyContainer> -->
<slot />
</div>
</CollapseTransition>
Expand All @@ -24,13 +24,18 @@
import CollapseHeader from './CollapseHeader.vue';
import { Skeleton } from 'ant-design-vue';
import LazyContainer from '../LazyContainer';
// import LazyContainer from '../LazyContainer';
import { triggerWindowResize } from '/@/utils/event/triggerWindowResizeEvent';
// hook
import { useTimeout } from '/@/hooks/core/useTimeout';
export default defineComponent({
components: { Skeleton, LazyContainer, CollapseHeader, CollapseTransition },
components: {
Skeleton,
// LazyContainer,
CollapseHeader,
CollapseTransition,
},
name: 'CollapseContainer',
props: {
// 标题
Expand Down
6 changes: 1 addition & 5 deletions src/components/Transition/src/ExpandTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ interface HTMLExpandElement extends HTMLElement {
_parent?: (Node & ParentNode & HTMLElement) | null;
_initialStyle: {
transition: string;
visibility: string | null;
overflow: string | null;
height?: string | null;
width?: string | null;
Expand All @@ -25,7 +24,6 @@ export default function (expandedParentClass = '', x = false) {
el._parent = el.parentNode as (Node & ParentNode & HTMLElement) | null;
el._initialStyle = {
transition: el.style.transition,
visibility: el.style.visibility,
overflow: el.style.overflow,
[sizeProperty]: el.style[sizeProperty],
};
Expand All @@ -35,7 +33,6 @@ export default function (expandedParentClass = '', x = false) {
const initialStyle = el._initialStyle;

el.style.setProperty('transition', 'none', 'important');
// Hide overflow to account for collapsed margins in the calculated height
el.style.overflow = 'hidden';
const offset = `${el[offsetProperty]}px`;

Expand All @@ -60,7 +57,6 @@ export default function (expandedParentClass = '', x = false) {
leave(el: HTMLExpandElement) {
el._initialStyle = {
transition: '',
visibility: '',
overflow: el.style.overflow,
[sizeProperty]: el.style[sizeProperty],
};
Expand Down Expand Up @@ -88,6 +84,6 @@ export default function (expandedParentClass = '', x = false) {
const size = el._initialStyle[sizeProperty];
el.style.overflow = el._initialStyle.overflow!;
if (size != null) el.style[sizeProperty] = size;
Reflect.deleteProperty(el, '_initialStyle');
delete (el as any)._initialStyle;
}
}
1 change: 0 additions & 1 deletion src/views/demo/form/AdvancedForm.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<div class="m-4">
<div class="mb-4"> </div>
<CollapseContainer title="基础收缩示例">
<BasicForm @register="register" />
</CollapseContainer>
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const vitePlugins: VitePlugin[] = [];
if (isReportMode()) {
// report
rollupPlugins.push(
visualizer({ filename: './node_modules/.cache/stats.html', open: true }) as Plugin
visualizer({ filename: './build/.cache/stats.html', open: true }) as Plugin
);
}
if (isBuildGzip() || isSiteMode()) {
Expand Down

0 comments on commit a0b09e7

Please sign in to comment.