修复表单组件样式和单元测试用例 (#7)

* fix: loading small style, search style and dialog style

* fix: scroll to top

* fix mobile scroll

* fix scroll to top

* 文档细节优化

* unit test

* dialog and image-preview unit test

* fix form component style

* fix radio and checkbox style

* fix search component style
This commit is contained in:
张敏
2017-04-24 17:33:40 +08:00
committed by GitHub
parent bdbaa75b38
commit 034c66a77f
13 changed files with 146 additions and 64 deletions
+2 -6
View File
@@ -9,13 +9,8 @@ let instance;
let dialogQueue = [];
const defaultCallback = action => {
/* istanbul ignore else */
if (currentDialog) {
const callback = currentDialog.callback;
if (typeof callback === 'function') {
callback(action);
}
if (currentDialog.resolve && action === 'confirm') {
currentDialog.resolve(action);
} else if (currentDialog.reject && action === 'cancel') {
@@ -43,6 +38,7 @@ const showNextDialog = () => {
const options = currentDialog.options;
for (const prop in options) {
/* istanbul ignore else */
if (options.hasOwnProperty(prop)) {
instance[prop] = options[prop];
}
+2
View File
@@ -60,12 +60,14 @@ export default {
},
close() {
/* istanbul ignore if */
if (this.closing) return;
this.closing = true;
this.value = false;
/* istanbul ignore else */
if (this.lockOnScroll) {
setTimeout(() => {
if (this.overlay && this.bodyOverflow !== 'hidden') {
+2 -1
View File
@@ -74,9 +74,10 @@ export default {
this.value = false;
/* istanbul ignore else */
if (this.lockOnScroll) {
setTimeout(() => {
if (this.modal && this.bodyOverflow !== 'hidden') {
if (this.overlay && this.bodyOverflow !== 'hidden') {
document.body.style.overflow = this.bodyOverflow;
}
this.bodyOverflow = null;
+4 -2
View File
@@ -36,7 +36,8 @@ module.exports = {
{
keywords: ['location'],
src: '其他分店.svg',
css: 'location'
css: 'location',
'correct_contour_direction': true
},
{
keywords: ['upgrade'],
@@ -97,7 +98,8 @@ module.exports = {
{
keywords: ['logistics'],
src: '物流.svg',
css: 'logistics'
css: 'logistics',
'correct_contour_direction': true
},
{
keywords: ['edit'],
+2
View File
@@ -15,6 +15,7 @@
height: 22px;
margin-right: 15px;
float: left;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
@e control {
@@ -31,6 +32,7 @@
line-height: 22px;
margin-left: 37px;
display: block;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.van-icon {
+5 -5
View File
@@ -2,11 +2,11 @@
@font-face {
font-family: 'vant-icon';
src: url('https://b.yzcdn.cn/zanui/icon/vant-icon-587aa52c96.eot');
src: url('https://b.yzcdn.cn/zanui/icon/vant-icon-587aa52c96.eot?#iefix') format('embedded-opentype'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-587aa52c96.woff2') format('woff2'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-587aa52c96.woff') format('woff'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-587aa52c96.ttf') format('truetype')
src: url('https://b.yzcdn.cn/zanui/icon/vant-icon-9e3e482229.eot');
src: url('https://b.yzcdn.cn/zanui/icon/vant-icon-9e3e482229.eot?#iefix') format('embedded-opentype'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-9e3e482229.woff2') format('woff2'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-9e3e482229.woff') format('woff'),
url('https://b.yzcdn.cn/zanui/icon/vant-icon-9e3e482229.ttf') format('truetype')
}
.van-icon {
+15 -4
View File
@@ -1,13 +1,20 @@
@import './mixins/border_retina.css';
@component-namespace van {
@b panel {
background: #fff;
border-top: 1px solid #E5E5E5;
border-bottom: 1px solid #E5E5E5;
position: relative;
&::after {
@mixin border-retina (top, bottom);
}
@e header {
padding: 10px 15px;
position: relative;
border-bottom: 1px solid #E5E5E5;
&::after {
@mixin border-retina (bottom);
}
}
@e title {
@@ -29,8 +36,12 @@
}
@e footer {
border-top: 1px solid #E5E5E5;
padding: 10px 15px;
position: relative;
&::after {
@mixin border-retina (top);
}
}
}
}
+2
View File
@@ -14,6 +14,7 @@
position: relative;
height: 22px;
float: left;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
@e control {
@@ -30,6 +31,7 @@
line-height: 22px;
display: block;
margin-left: 37px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.van-icon {
+2 -1
View File
@@ -44,7 +44,8 @@
.van-icon-search {
color: $c-gray-darker;
position: absolute;
top: 8px;
top: 50%;
transform: translateY(-50%);
left: 10px;
font-size: 16px;
line-height: 1;