mirror of
https://github.com/vform666/variant-form3-vite.git
synced 2025-06-21 17:39:57 +08:00
升级到3.0.5:
1. 优化卡片组件card的接收拖拽区域大小; 2. 修复type属性编辑器配置错误的问题。
This commit is contained in:
@ -716,7 +716,7 @@ export function createDesigner(vueInstance) {
|
||||
newWidget.id = newWidget.type.replace(/-/g, '') + tempId
|
||||
//console.log('test id===', newWidget.id)
|
||||
newWidget.options.name = newWidget.id
|
||||
newWidget.options.label = newWidget.type.toLowerCase()
|
||||
newWidget.options.label = newWidget.options.label || newWidget.type.toLowerCase()
|
||||
|
||||
delete newWidget.displayName
|
||||
return newWidget
|
||||
|
@ -249,6 +249,7 @@
|
||||
let labelKey = this.fieldListApi.labelKey || 'label'
|
||||
let nameKey = this.fieldListApi.nameKey || 'name'
|
||||
|
||||
this.fieldList.splice(0, this.fieldList.length) //清空已有
|
||||
res.data.forEach(fieldItem => {
|
||||
this.fieldList.push({
|
||||
label: fieldItem[labelKey],
|
||||
|
@ -103,6 +103,7 @@
|
||||
import i18n from "@/utils/i18n"
|
||||
import eventBus from "@/utils/event-bus"
|
||||
import emitter from "@/utils/emitter";
|
||||
import { propertyRegistered } from "@/components/form-designer/setting-panel/propertyRegister";
|
||||
|
||||
const {COMMON_PROPERTIES, ADVANCED_PROPERTIES, EVENT_PROPERTIES} = WidgetProperties
|
||||
|
||||
@ -218,6 +219,14 @@
|
||||
return false
|
||||
}
|
||||
|
||||
/* alert组件注册了两个type属性编辑器,跳过第一个type属性编辑器,只显示第二个alert-type属性编辑器!! */
|
||||
if (propName.indexOf('-') <= -1) {
|
||||
let uniquePropName = this.selectedWidget.type + '-' + propName
|
||||
if (propertyRegistered(uniquePropName)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
let originalPropName = propName.replace(this.selectedWidget.type + '-', '') //去掉组件名称前缀-,如果有的话!!
|
||||
return this.designer.hasConfig(this.selectedWidget, originalPropName)
|
||||
},
|
||||
|
@ -160,6 +160,14 @@ export function registerEventProperty(uniquePropName, propEditorName) {
|
||||
EVENT_PROPERTIES[uniquePropName] = propEditorName
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断属性是否已注册
|
||||
* @param uniquePropName 属性名称(保证名称唯一,不跟其他组件属性冲突)
|
||||
*/
|
||||
export function propertyRegistered(uniquePropName) {
|
||||
return !!COMMON_PROPERTIES[uniquePropName] || !!ADVANCED_PROPERTIES[uniquePropName] || !!EVENT_PROPERTIES[uniquePropName]
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册常见属性对应的属性编辑器
|
||||
* @param app
|
||||
|
Reference in New Issue
Block a user