diff --git a/src/area/api.ts b/src/area/api.ts index 85a26c7db..0064d1b7f 100644 --- a/src/area/api.ts +++ b/src/area/api.ts @@ -140,6 +140,15 @@ namespace nasl.ui { } }) disabled: nasl.core.Boolean = false; + @Prop({ + group: '主要属性', + title: '占位提示', + description: '', + setter: { + concept: "InputSetter" + } + }) + placeholder: nasl.core.String; @Event({ title: '点击右上方完成按钮', description: '点击右上方完成按钮' diff --git a/src/area/api.yaml b/src/area/api.yaml index 585fda633..c2299283e 100644 --- a/src/area/api.yaml +++ b/src/area/api.yaml @@ -100,6 +100,11 @@ default: false group: 状态属性 description: 置灰显示,且禁止任何交互(焦点、点击、选择、输入等) + - name: placeholder + title: 占位提示 + type: string + group: 主要属性 + description: "" slots: - concept: Slot name: default diff --git a/src/area/demo/index.vue b/src/area/demo/index.vue index 02e4d0e2f..08a66e5eb 100644 --- a/src/area/demo/index.vue +++ b/src/area/demo/index.vue @@ -27,6 +27,11 @@ + + + + + diff --git a/src/area/index.js b/src/area/index.js index 5d5f90800..11278bf58 100644 --- a/src/area/index.js +++ b/src/area/index.js @@ -55,6 +55,9 @@ export default createComponent({ type: String, default: 'json', }, + placeholder: { + type: String, + }, labelField: { type: String, default: '', @@ -615,6 +618,7 @@ export default createComponent({ scopedSlots={tempSlot} readonly disabled={this.disabled} + placeholder={this.placeholder} isLink input-align={this.inputAlign || 'right'} onClick={this.inDesigner() ? this.designerOpen : this.onClickField} diff --git a/src/area/test/__snapshots__/demo.spec.js.snap b/src/area/test/__snapshots__/demo.spec.js.snap index 9b4a53ae4..4bee32771 100644 --- a/src/area/test/__snapshots__/demo.spec.js.snap +++ b/src/area/test/__snapshots__/demo.spec.js.snap @@ -44,5 +44,15 @@ exports[`renders demo correctly 1`] = ` +
+
+
+
标题
+
+
+
+
+
+
`; diff --git a/src/calendar/api.ts b/src/calendar/api.ts index a2a7e07db..1d4530ef2 100644 --- a/src/calendar/api.ts +++ b/src/calendar/api.ts @@ -112,6 +112,15 @@ namespace nasl.ui { } }) disabled: nasl.core.Boolean = false; + @Prop({ + group: '主要属性', + title: '占位提示', + description: '', + setter: { + concept: "InputSetter" + } + }) + placeholder: nasl.core.String; @Event({ title: '确认', description: '点击完成按钮时触发的事件' diff --git a/src/calendar/api.yaml b/src/calendar/api.yaml index 1f3df9dec..798673417 100644 --- a/src/calendar/api.yaml +++ b/src/calendar/api.yaml @@ -82,6 +82,11 @@ default: false description: 置灰显示,且禁止任何交互(焦点、点击、选择、输入等) group: 状态属性 + - name: placeholder + title: 占位提示 + type: string + group: 主要属性 + description: "" slots: - concept: Slot name: default diff --git a/src/calendar/demo/index.vue b/src/calendar/demo/index.vue index 0c2d43b69..75c4465e3 100644 --- a/src/calendar/demo/index.vue +++ b/src/calendar/demo/index.vue @@ -29,6 +29,18 @@ > + + + + + + + diff --git a/src/calendar/index.js b/src/calendar/index.js index f53ddc669..b7d59f514 100644 --- a/src/calendar/index.js +++ b/src/calendar/index.js @@ -48,6 +48,9 @@ export default createComponent({ rowHeight: [Number, String], confirmText: String, rangePrompt: String, + placeholder: { + type: String, + }, labelField: { type: String, default: '', @@ -286,7 +289,9 @@ export default createComponent({ this.currentValue = val; const date = dayjs(this.currentValue); - const value = date.isValid() ? date.format('YYYY-MM-DD') : this.currentValue; + const value = date.isValid() + ? date.format('YYYY-MM-DD') + : this.currentValue; this.$emit('update:value', value); this.$emit('update:default-date', value); }, @@ -307,7 +312,9 @@ export default createComponent({ this.currentValue = val; const date = dayjs(this.currentValue); - const value = date.isValid() ? date.format('YYYY-MM-DD') : this.currentValue; + const value = date.isValid() + ? date.format('YYYY-MM-DD') + : this.currentValue; this.$emit('update:value', value); this.$emit('update:default-date', value); this.scrollIntoView(); @@ -455,7 +462,9 @@ export default createComponent({ this.currentValue = this.currentDate; const date = dayjs(this.currentValue); - const value = date.isValid() ? date.format('YYYY-MM-DD') : this.currentValue; + const value = date.isValid() + ? date.format('YYYY-MM-DD') + : this.currentValue; this.$emit('update:value', value); this.$emit('update:default-date', value); @@ -634,6 +643,7 @@ export default createComponent({ scopedSlots={tempSlot} readonly disabled={this.disabled} + placeholder={this.placeholder} isLink input-align={this.inputAlign || 'right'} onClick={this.inDesigner() ? this.designerOpen : this.togglePopup} diff --git a/src/calendar/test/__snapshots__/demo.spec.js.snap b/src/calendar/test/__snapshots__/demo.spec.js.snap index c818a7c0f..fed6ddee6 100644 --- a/src/calendar/test/__snapshots__/demo.spec.js.snap +++ b/src/calendar/test/__snapshots__/demo.spec.js.snap @@ -32,5 +32,20 @@ exports[`renders demo correctly 1`] = ` +
+
+
日期选择
+
+
+
+
+
+
+
+
+
+ +
+
`; diff --git a/src/datetime-picker/api.ts b/src/datetime-picker/api.ts index fd1cb61e0..9db57992a 100644 --- a/src/datetime-picker/api.ts +++ b/src/datetime-picker/api.ts @@ -302,6 +302,15 @@ namespace nasl.ui { } }) disabled: nasl.core.Boolean = false; + @Prop({ + group: '主要属性', + title: '占位提示', + description: '', + setter: { + concept: "InputSetter" + } + }) + placeholder: nasl.core.String; @Event({ title: '确认', description: '点击完成按钮时触发的事件' diff --git a/src/datetime-picker/api.yaml b/src/datetime-picker/api.yaml index 42a7bfcfc..300497b15 100644 --- a/src/datetime-picker/api.yaml +++ b/src/datetime-picker/api.yaml @@ -325,6 +325,11 @@ default: false description: 置灰显示,且禁止任何交互(焦点、点击、选择、输入等) group: 状态属性 + - name: placeholder + title: 占位提示 + type: string + group: 主要属性 + description: "" slots: - concept: Slot name: default diff --git a/src/datetime-picker/demo/index.vue b/src/datetime-picker/demo/index.vue index 9b5a56c0e..4875da000 100644 --- a/src/datetime-picker/demo/index.vue +++ b/src/datetime-picker/demo/index.vue @@ -117,8 +117,8 @@ - - + + diff --git a/src/datetime-picker/index.js b/src/datetime-picker/index.js index c2bdec55e..0358eebb2 100644 --- a/src/datetime-picker/index.js +++ b/src/datetime-picker/index.js @@ -25,7 +25,9 @@ export default createComponent({ }, inputAlign: String, closeOnClickOverlay: Boolean, - placeholder: String, + placeholder: { + type: String, + }, range: Boolean, startValue: String, endValue: String, diff --git a/src/datetime-picker/test/__snapshots__/demo.spec.js.snap b/src/datetime-picker/test/__snapshots__/demo.spec.js.snap index a6b523519..62c8bfea6 100644 --- a/src/datetime-picker/test/__snapshots__/demo.spec.js.snap +++ b/src/datetime-picker/test/__snapshots__/demo.spec.js.snap @@ -124,7 +124,7 @@ exports[`renders demo correctly 1`] = `
-
+