diff --git a/package.json b/package.json
index 39406809b09..e5126960382 100644
--- a/package.json
+++ b/package.json
@@ -32,7 +32,8 @@
"husky": {
"hooks": {
"pre-commit": "lint-staged",
- "commit-msg": "vant commit-lint"
+ "commit-msg": "vant commit-lint",
+ "pre-push": "yarn test"
}
},
"lint-staged": {
diff --git a/src/address-list/test/__snapshots__/demo.spec.js.snap b/src/address-list/test/__snapshots__/demo.spec.js.snap
index deb69f0b5a2..df53e0618ae 100644
--- a/src/address-list/test/__snapshots__/demo.spec.js.snap
+++ b/src/address-list/test/__snapshots__/demo.spec.js.snap
@@ -16,9 +16,7 @@ exports[`renders demo correctly 1`] = `
设为默认
-
-
-
+
@@ -33,9 +31,7 @@ exports[`renders demo correctly 1`] = `
设为默认
-
-
-
+
@@ -52,9 +48,7 @@ exports[`renders demo correctly 1`] = `
设为默认
-
-
-
+
diff --git a/src/address-list/test/__snapshots__/index.spec.js.snap b/src/address-list/test/__snapshots__/index.spec.js.snap
index 40b7cbd61eb..e704931166e 100644
--- a/src/address-list/test/__snapshots__/index.spec.js.snap
+++ b/src/address-list/test/__snapshots__/index.spec.js.snap
@@ -14,9 +14,7 @@ exports[`unswitchable 1`] = `
设为默认
-
-
-
+
@@ -31,9 +29,7 @@ exports[`unswitchable 1`] = `
设为默认
-
-
-
+
diff --git a/src/grid-item/index.js b/src/grid-item/index.js
index 5dad92519d4..50c2a4a7f3e 100644
--- a/src/grid-item/index.js
+++ b/src/grid-item/index.js
@@ -3,6 +3,7 @@ import { BORDER } from '../utils/constant';
import { ChildrenMixin } from '../mixins/relation';
import { route, routeProps } from '../utils/router';
import Icon from '../icon';
+import Info from '../info';
const [createComponent, bem] = createNamespace('grid-item');
@@ -69,16 +70,13 @@ export default createComponent({
}
return [
- this.slots('icon') ||
- (this.icon && (
-
- )),
+
+ {this.slots('icon') ||
+ (this.icon && (
+
+ ))}
+
+
,
this.slots('text') || (this.text && {this.text})
];
}
diff --git a/src/grid/README.md b/src/grid/README.md
index d19bc8d82a9..556708e6351 100644
--- a/src/grid/README.md
+++ b/src/grid/README.md
@@ -92,6 +92,9 @@ Vue.use(Grid).use(GridItem);
+
+ slot=icon
+
```
diff --git a/src/grid/README.zh-CN.md b/src/grid/README.zh-CN.md
index 1c1ff1fc576..01d652a8c1e 100644
--- a/src/grid/README.zh-CN.md
+++ b/src/grid/README.zh-CN.md
@@ -110,6 +110,9 @@ Vue.use(Grid).use(GridItem);
+
+ slot=icon
+
```
diff --git a/src/grid/demo/index.vue b/src/grid/demo/index.vue
index 4833886b2c8..7631e0f0c6f 100644
--- a/src/grid/demo/index.vue
+++ b/src/grid/demo/index.vue
@@ -49,6 +49,9 @@
+
+ slot=icon
+
diff --git a/src/grid/test/__snapshots__/demo.spec.js.snap b/src/grid/test/__snapshots__/demo.spec.js.snap
index 69390c9b170..88b7b57a19e 100644
--- a/src/grid/test/__snapshots__/demo.spec.js.snap
+++ b/src/grid/test/__snapshots__/demo.spec.js.snap
@@ -5,48 +5,88 @@ exports[`renders demo correctly 1`] = `
@@ -81,98 +121,183 @@ exports[`renders demo correctly 1`] = `
diff --git a/src/grid/test/__snapshots__/index.spec.js.snap b/src/grid/test/__snapshots__/index.spec.js.snap
index a66e337fb3e..d940f64af6a 100644
--- a/src/grid/test/__snapshots__/index.spec.js.snap
+++ b/src/grid/test/__snapshots__/index.spec.js.snap
@@ -3,8 +3,12 @@
exports[`icon-size prop 1`] = `
`;
@@ -12,13 +16,25 @@ exports[`icon-size prop 1`] = `
exports[`sqaure and set gutter 1`] = `
`;
diff --git a/src/select/test/__snapshots__/demo.spec.js.snap b/src/select/test/__snapshots__/demo.spec.js.snap
index 530720f9cb2..20b8ffd0698 100644
--- a/src/select/test/__snapshots__/demo.spec.js.snap
+++ b/src/select/test/__snapshots__/demo.spec.js.snap
@@ -4,7 +4,7 @@ exports[`renders demo correctly 1`] = `