fix: ssr error #3983 #3997

pull/4072/head
tanjinzhou 2021-05-12 13:10:07 +08:00
parent 726f6b4b2d
commit dcb34b08e9
9 changed files with 28 additions and 8 deletions

View File

@ -10,6 +10,12 @@
---
## 2.1.5
`2021-05-12`
- 🐞 Fix SSR time reporting error [#3983](https://github.com/vueComponent/ant-design-vue/issues/3983)
## 2.1.4
`2021-05-09`

View File

@ -10,6 +10,12 @@
---
## 2.1.5
`2021-05-12`
- 🐞 修复 SSR 时报错问题 [#3983](https://github.com/vueComponent/ant-design-vue/issues/3983)
## 2.1.4
`2021-05-09`

View File

@ -118,10 +118,16 @@ function babelify(js, modules) {
);
file.path = file.path.replace(/index\.(js|jsx|ts|tsx)$/, 'css.js');
this.push(file);
next();
} else {
next();
} else if (modules !== false) {
const content = file.contents.toString(encoding);
file.contents = Buffer.from(
content
.replace(/lodash-es/g, 'lodash')
.replace(/@ant-design\/icons-vue/g, '@ant-design/icons-vue/lib/icons'),
);
this.push(file);
}
next();
}),
);
if (modules === false) {

View File

@ -3,7 +3,7 @@
* https://github.com/component/classes.git
*/
import { indexOf } from 'lodash-es';
import indexOf from 'lodash-es/indexOf';
/**
* Whitespace regexp.

View File

@ -51,6 +51,7 @@ export const CarouselProps = {
slickGoTo: PropTypes.number,
responsive: PropTypes.array,
dotPosition: PropTypes.oneOf(tuple('top', 'bottom', 'left', 'right')),
verticalSwiping: PropTypes.looseBool.def(false),
};
const Carousel = defineComponent({

View File

@ -7,7 +7,7 @@ import {
computed,
onMounted,
} from 'vue';
import { isNumber } from 'lodash-es';
import isNumber from 'lodash-es/isNumber';
import BaseMixin from '../../_util/BaseMixin';
import cn from '../../_util/classNames';

View File

@ -13,7 +13,7 @@ import {
toRaw,
watch,
} from 'vue';
import { isEqual } from 'lodash-es';
import isEqual from 'lodash-es/isEqual';
const Menu = {
name: 'Menu',

View File

@ -1,6 +1,6 @@
{
"name": "ant-design-vue",
"version": "2.1.4",
"version": "2.1.5",
"title": "Ant Design Vue",
"description": "An enterprise-class UI design language and Vue-based implementation",
"keywords": [
@ -209,6 +209,7 @@
"async-validator": "^3.3.0",
"dom-align": "^1.10.4",
"dom-scroll-into-view": "^2.0.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.15",
"moment": "^2.27.0",
"omit.js": "^2.0.0",

2
v2-doc

@ -1 +1 @@
Subproject commit 4da56dac85f43ad7a288951cbf09d860ecf93bb4
Subproject commit d197053285b81e77718621c0b5b94cb3b21831a2