diff --git a/src/address-edit/test/__snapshots__/index.spec.js.snap b/src/address-edit/test/__snapshots__/index.spec.js.snap index f46360709..0a71ccce1 100644 --- a/src/address-edit/test/__snapshots__/index.spec.js.snap +++ b/src/address-edit/test/__snapshots__/index.spec.js.snap @@ -5,19 +5,19 @@ exports[`create a AddressEdit 1`] = `
姓名
-
+
电话
-
+
地区
-
+
@@ -28,7 +28,7 @@ exports[`create a AddressEdit 1`] = `
详细地址
-
+
@@ -44,19 +44,19 @@ exports[`create a AddressEdit with props 1`] = `
姓名
-
+
电话
-
+
地区
-
+
@@ -67,7 +67,7 @@ exports[`create a AddressEdit with props 1`] = `
详细地址
-
+
@@ -75,7 +75,7 @@ exports[`create a AddressEdit with props 1`] = `
邮政编码
-
+
@@ -97,19 +97,19 @@ exports[`set-default 1`] = `
姓名
-
+
电话
-
+
地区
-
+
@@ -120,7 +120,7 @@ exports[`set-default 1`] = `
详细地址
-
+
@@ -128,7 +128,7 @@ exports[`set-default 1`] = `
邮政编码
-
+
@@ -150,19 +150,19 @@ exports[`show area component 1`] = `
姓名
-
+
电话
-
+
地区
-
+
@@ -173,7 +173,7 @@ exports[`show area component 1`] = `
详细地址
-
+
@@ -181,7 +181,7 @@ exports[`show area component 1`] = `
邮政编码
-
+
@@ -203,19 +203,19 @@ exports[`show area component 2`] = `
姓名
-
+
电话
-
+
地区
-
+
@@ -226,7 +226,7 @@ exports[`show area component 2`] = `
详细地址
-
+
@@ -234,7 +234,7 @@ exports[`show area component 2`] = `
邮政编码
-
+
@@ -256,19 +256,19 @@ exports[`valid area placeholder confirm 1`] = `
姓名
-
+
电话
-
+
地区
-
+
@@ -279,7 +279,7 @@ exports[`valid area placeholder confirm 1`] = `
详细地址
-
+
diff --git a/src/coupon-list/test/__snapshots__/index.spec.js.snap b/src/coupon-list/test/__snapshots__/index.spec.js.snap index bc7338623..29171bccc 100644 --- a/src/coupon-list/test/__snapshots__/index.spec.js.snap +++ b/src/coupon-list/test/__snapshots__/index.spec.js.snap @@ -4,7 +4,7 @@ exports[`empty-image prop 1`] = `
-
+
@@ -54,7 +54,7 @@ exports[`render coupon list 1`] = `
-
+
@@ -200,7 +200,7 @@ exports[`render empty coupon list 1`] = `
-
+
diff --git a/src/field/index.js b/src/field/index.js index e6a5d1604..908f4a4eb 100644 --- a/src/field/index.js +++ b/src/field/index.js @@ -417,6 +417,7 @@ export default createComponent({ required={this.required} clickable={this.clickable} titleStyle={this.labelStyle} + valueClass={bem('value')} titleClass={[bem('label', labelAlign), this.labelClass]} arrowDirection={this.arrowDirection} class={bem({ diff --git a/src/field/index.less b/src/field/index.less index d0ee6cd15..484dd308e 100644 --- a/src/field/index.less +++ b/src/field/index.less @@ -14,6 +14,10 @@ } } + &__value { + overflow: visible; + } + &__body { display: flex; align-items: center; diff --git a/src/field/test/__snapshots__/index.spec.js.snap b/src/field/test/__snapshots__/index.spec.js.snap index 15b8e29c4..d9c28ec52 100644 --- a/src/field/test/__snapshots__/index.spec.js.snap +++ b/src/field/test/__snapshots__/index.spec.js.snap @@ -2,7 +2,7 @@ exports[`arrow-direction prop 1`] = `
-
+
@@ -11,7 +11,7 @@ exports[`arrow-direction prop 1`] = ` exports[`clearable 1`] = `
-
+
@@ -19,7 +19,7 @@ exports[`clearable 1`] = ` exports[`clearable 2`] = `
-
+
@@ -29,7 +29,7 @@ exports[`clearable 2`] = ` exports[`label-class prop 1`] = `
Label
-
+
@@ -38,7 +38,7 @@ exports[`label-class prop 1`] = ` exports[`label-width prop with unit 1`] = `
Label
-
+
@@ -47,7 +47,7 @@ exports[`label-width prop with unit 1`] = ` exports[`label-width prop without unit 1`] = `
Label
-
+
@@ -55,7 +55,7 @@ exports[`label-width prop without unit 1`] = ` exports[`name prop 1`] = `
-
+
@@ -63,7 +63,7 @@ exports[`name prop 1`] = ` exports[`reach max word-limit 1`] = `
-
+
3/3
@@ -72,9 +72,9 @@ exports[`reach max word-limit 1`] = ` exports[`render input slot 1`] = `
-
+
-
Custom Input
+
Custom Input
@@ -83,7 +83,7 @@ exports[`render input slot 1`] = ` exports[`render label slot 1`] = `
Custom Label
-
+
@@ -91,7 +91,7 @@ exports[`render label slot 1`] = ` exports[`render textarea 1`] = `
-
+
@@ -99,7 +99,7 @@ exports[`render textarea 1`] = ` exports[`size prop 1`] = `
-
+
diff --git a/src/form/demo/FieldType.vue b/src/form/demo/FieldType.vue index f01f43b1e..0e682b1d6 100644 --- a/src/form/demo/FieldType.vue +++ b/src/form/demo/FieldType.vue @@ -13,6 +13,10 @@ + + + + @@ -31,6 +35,7 @@ export default { rate: '评分', submit: '提交', switch: '开关', + slider: '滑块', stepper: '步进器', checkbox: '复选框', fieldType: '表单项类型', @@ -40,6 +45,7 @@ export default { rate: 'Rate', submit: 'Submit', switch: 'Switch', + slider: 'Slider', stepper: 'Stepper', checkbox: 'Checkbox', fieldType: 'Field Type', @@ -50,6 +56,7 @@ export default { data() { return { rate: 3, + slider: 50, stepper: 1, checkbox: false, switchChecked: false, diff --git a/src/form/index.js b/src/form/index.js index 1f062bebe..577e85fe8 100644 --- a/src/form/index.js +++ b/src/form/index.js @@ -1,4 +1,3 @@ -// Utils import { createNamespace } from '../utils'; const [createComponent, bem] = createNamespace('form'); diff --git a/src/form/test/__snapshots__/demo.spec.js.snap b/src/form/test/__snapshots__/demo.spec.js.snap index d93531cc0..df0931314 100644 --- a/src/form/test/__snapshots__/demo.spec.js.snap +++ b/src/form/test/__snapshots__/demo.spec.js.snap @@ -6,13 +6,13 @@ exports[`renders demo correctly 1`] = `
用户名
-
+
密码
-
+
@@ -23,7 +23,7 @@ exports[`renders demo correctly 1`] = `
复选框
-
+
开关
-
+
@@ -46,6 +46,53 @@ exports[`renders demo correctly 1`] = `
+
+
评分
+
+
+
+
+ + + + + +
+
+
+
+
+
+
滑块
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
步进器
+
+
+
+
+
+
+
+
diff --git a/src/search/test/__snapshots__/index.spec.js.snap b/src/search/test/__snapshots__/index.spec.js.snap index 432d2c7d0..d68323425 100644 --- a/src/search/test/__snapshots__/index.spec.js.snap +++ b/src/search/test/__snapshots__/index.spec.js.snap @@ -6,7 +6,7 @@ exports[`action-text prop 1`] = `
-
+
@@ -22,7 +22,7 @@ exports[`label slot 1`] = `
-
+
@@ -36,7 +36,7 @@ exports[`left-icon prop 1`] = `
-
+
@@ -50,7 +50,7 @@ exports[`right-icon prop 1`] = `
-
+
@@ -67,7 +67,7 @@ exports[`right-icon slot 1`] = `
-
+
Custom Right Icon
diff --git a/src/slider/demo/index.vue b/src/slider/demo/index.vue index 4f4fee426..a54deba0a 100644 --- a/src/slider/demo/index.vue +++ b/src/slider/demo/index.vue @@ -93,8 +93,12 @@ export default { background: @white; user-select: none; - .van-slider { - margin: 0 @padding-md @padding-xl; + .van-doc-demo-block { + padding: 0 @padding-md 20px; + } + + .van-doc-demo-block__title { + padding-left: 0; } .custom-button { @@ -106,9 +110,5 @@ export default { background-color: @red; border-radius: 100px; } - - .van-doc-demo-block__title { - padding-top: 25px; - } } diff --git a/src/slider/index.js b/src/slider/index.js index 1aeeb38df..9cbda38c5 100644 --- a/src/slider/index.js +++ b/src/slider/index.js @@ -1,11 +1,12 @@ import { createNamespace, addUnit } from '../utils'; -import { TouchMixin } from '../mixins/touch'; import { preventDefault } from '../utils/dom/event'; +import { TouchMixin } from '../mixins/touch'; +import { FieldMixin } from '../mixins/field'; const [createComponent, bem] = createNamespace('slider'); export default createComponent({ - mixins: [TouchMixin], + mixins: [TouchMixin, FieldMixin], props: { disabled: Boolean, diff --git a/src/slider/index.less b/src/slider/index.less index 17c4c0ea0..32c8d7419 100644 --- a/src/slider/index.less +++ b/src/slider/index.less @@ -2,6 +2,7 @@ .van-slider { position: relative; + width: 100%; background-color: @slider-inactive-background-color; border-radius: @border-radius-max; cursor: pointer;