diff --git a/src/components/GuipDialog.vue b/src/components/GuipDialog.vue index 88578cd..68112e7 100644 --- a/src/components/GuipDialog.vue +++ b/src/components/GuipDialog.vue @@ -11,7 +11,6 @@ > - {{ cancelText }} diff --git a/src/components/GuipSelect.vue b/src/components/GuipSelect.vue index d0e5667..e43a309 100644 --- a/src/components/GuipSelect.vue +++ b/src/components/GuipSelect.vue @@ -61,6 +61,13 @@ export default { processedOptions() { // 处理options为空的情况 let options = this.options || []; + // 如果是 [1,12,22] 格式 + if (Array.isArray(options) && options.every(item => typeof item !== 'object')) { + return options.map((item, index) => ({ + [this.valueKey]: index, + [this.labelKey]: item + })); + } // 如果是对象格式,转换为数组 if (options && !Array.isArray(options)) { diff --git a/src/views/elementGroups.vue b/src/views/elementGroups.vue index 285e805..c2be0a3 100644 --- a/src/views/elementGroups.vue +++ b/src/views/elementGroups.vue @@ -75,12 +75,17 @@ value-key="id" /> - 普通数组类型下拉框: + 数组套对象类型下拉框: + 纯数组[1,2]下拉框: + + + 对象格式下拉框: @@ -521,6 +526,8 @@ 打开弹框(标题巨中、按钮居中) + 打开弹框-放弃原按钮,自定义 + 展示加载动画 2s @@ -554,12 +561,27 @@ 这是一个自定义内容的弹框。 - + + + 这是一个自定义内容的弹框。 + + + 这是一个自定义内容的弹框。 + 这是一个自定义内容的弹框。 + 这是一个自定义内容的弹框。 + 这是一个自定义内容的弹框。 + + + 取消 + ⚡️咖啡不加糖喔 + @@ -672,6 +694,7 @@ export default { switchValue1: 1, switchValue2: '0', dialogVisible1: false, + dialogVisible2: false, dialogVisible: false,//是否展示弹框 showCancelButton: true, // 控制是否显示取消按钮 showCloseButton: true, // 控制是否显示关闭按钮 @@ -1110,6 +1133,9 @@ export default { openDialog1() { this.dialogVisible1 = true; }, + openDialog2() { + this.dialogVisible2 = true; + }, // 确认按钮事件 handleConfirm() { this.$message.success('点击了确认按钮'); @@ -1120,11 +1146,14 @@ export default { this.$message.warning('点击了取消按钮'); this.dialogVisible = false; this.dialogVisible1 = false; + this.dialogVisible2 = false; }, // 关闭弹框事件 handleClose() { this.$message.info('弹框已关闭'); this.dialogVisible = false; + this.dialogVisible1 = false; + this.dialogVisible2 = false; }, dialogVisibleChange(data) { console.log(data, 'data098908090'); @@ -1349,4 +1378,9 @@ export default { background: linear-gradient(290deg, #FF4143 4%, #FF768B 92%); } } +.btns{ + display: flex; + justify-content: flex-end; + align-items: center; +} \ No newline at end of file
这是一个自定义内容的弹框。