diff --git a/src/form/README.md b/src/form/README.md index d299c4b6c..a03095d81 100644 --- a/src/form/README.md +++ b/src/form/README.md @@ -195,6 +195,49 @@ export default { }; ``` +### Field Type - Picker + +```html + + + + +``` + +```js +export default { + data() { + return { + value: '', + columns: ['Delaware', 'Florida', 'Georqia', 'Indiana', 'Maine'], + showPicker: false, + }; + }, + methods: { + onConfirm(value) { + this.value = value; + this.showPicker = false; + }, + onCancel() { + this.showPicker = false; + }, + }, +}; +``` + ## API ### Props diff --git a/src/form/README.zh-CN.md b/src/form/README.zh-CN.md index 0344c7ddd..3b38dbeb5 100644 --- a/src/form/README.zh-CN.md +++ b/src/form/README.zh-CN.md @@ -201,6 +201,49 @@ export default { }; ``` +### 表单项类型 - 选择器 + +```html + + + + +``` + +```js +export default { + data() { + return { + value: '', + columns: ['杭州', '宁波', '温州', '嘉兴', '湖州'], + showPicker: false, + }; + }, + methods: { + onConfirm(value) { + this.value = value; + this.showPicker = false; + }, + onCancel() { + this.showPicker = false; + }, + }, +}; +``` + ## API ### Props diff --git a/src/form/demo/FieldType.vue b/src/form/demo/FieldType.vue index 46613f326..abe351dec 100644 --- a/src/form/demo/FieldType.vue +++ b/src/form/demo/FieldType.vue @@ -47,6 +47,8 @@ + +
{{ $t('submit') }}
@@ -55,6 +57,8 @@ diff --git a/src/form/test/__snapshots__/demo.spec.js.snap b/src/form/test/__snapshots__/demo.spec.js.snap index b4e339164..fe0c60088 100644 --- a/src/form/test/__snapshots__/demo.spec.js.snap +++ b/src/form/test/__snapshots__/demo.spec.js.snap @@ -16,7 +16,7 @@ exports[`renders demo correctly 1`] = `
-
+
@@ -26,7 +26,7 @@ exports[`renders demo correctly 1`] = `
-
+
@@ -75,7 +75,7 @@ exports[`renders demo correctly 1`] = `
-
+
+
步进器
+
+
+
+
+
+
+
+
评分
@@ -125,16 +135,6 @@ exports[`renders demo correctly 1`] = `
-
-
步进器
-
-
-
-
-
-
-
-
文件上传
@@ -157,7 +157,16 @@ exports[`renders demo correctly 1`] = `
-
+
+
+
选择器
+
+
+
+
+ +
+