From 8ef3aee8602a1cb64fc547908f6b86e6f46043c5 Mon Sep 17 00:00:00 2001
From: Donald Shen <825870831@qq.com>
Date: Tue, 12 Nov 2019 15:04:16 +0800
Subject: [PATCH 3/4] =?UTF-8?q?chore:=20push=E6=97=B6=E8=BF=90=E8=A1=8Ctes?=
=?UTF-8?q?t?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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": {
From 709b459fc6de182f54eba93edfde98205af606ae Mon Sep 17 00:00:00 2001
From: Donald Shen <825870831@qq.com>
Date: Tue, 12 Nov 2019 15:46:15 +0800
Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=E6=9B=B4=E5=A5=BD=E7=9A=84slot?=
=?UTF-8?q?=E6=95=88=E6=9E=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/grid-item/index.js | 19 +-
src/grid/README.zh-CN.md | 2 +-
src/grid/test/__snapshots__/demo.spec.js.snap | 245 +++++++++++++-----
.../test/__snapshots__/index.spec.js.snap | 26 +-
4 files changed, 212 insertions(+), 80 deletions(-)
diff --git a/src/grid-item/index.js b/src/grid-item/index.js
index d3c2495c1e1..50c2a4a7f3e 100644
--- a/src/grid-item/index.js
+++ b/src/grid-item/index.js
@@ -68,20 +68,15 @@ export default createComponent({
if (slot) {
return slot;
}
- const slotIcon = this.slots('icon');
return [
- slotIcon && slotIcon,
- slotIcon &&
,
- !slotIcon && this.icon && (
-
- ),
+
+ {this.slots('icon') ||
+ (this.icon && (
+
+ ))}
+
+
,
this.slots('text') || (this.text &&
{this.text})
];
}
diff --git a/src/grid/README.zh-CN.md b/src/grid/README.zh-CN.md
index 17e4ff6d772..01d652a8c1e 100644
--- a/src/grid/README.zh-CN.md
+++ b/src/grid/README.zh-CN.md
@@ -104,7 +104,7 @@ Vue.use(Grid).use(GridItem);
### 提示信息
-设置`dot`属性后,会在图标右上角展示一个小红点。设置`info`属性后,会在图标右上角展示相应的徽标。注意使用icon插槽时,需要自行调整info位置
+设置`dot`属性后,会在图标右上角展示一个小红点。设置`info`属性后,会在图标右上角展示相应的徽标
```html
diff --git a/src/grid/test/__snapshots__/demo.spec.js.snap b/src/grid/test/__snapshots__/demo.spec.js.snap
index fbfbc7dcc79..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,102 +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`] = `
`;