-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/draggable on component #21
Feature/draggable on component #21
Conversation
我觉的这里不要直接把之前的逻辑删掉 Everright-formEditor/packages/formEditor/index.vue Lines 21 to 50 in 034342d
dragMode: {
type: String,
default: 'icon',
validator: (value) => ['full', 'icon'].includes(value)
} 这样有两种选择,由使用者自由选择,你觉的怎么样? |
import Engine from '@engine/core'
import { baseWidgets, baseSetters } from '@engine/widgets'
Engine.registerWidgets(baseWidgets)
Engine.registerSetters(baseSetters)
// 物料
import { installedWidgets } from '@engine/utils'
import Widgets from './widgets.vue'
const groupBy = (arr, key) =>
(arr || []).reduce((acc, x = {}) => ({
...acc,
[x[key] ?? '未分组']: [...acc[x[key] ?? '未分组'] || [], x]
}), {})
const data =[...installedWidgets].sort((a: any,b: any) => a.rank - b.rank) <template v-for="([key, propConfig]) in currentProps" :key="key">
<FormItem :label="propConfig.label">
<component v-model:value="selected.props[key]" :is="baseSetters[propConfig.eNodeType]" v-bind="propConfig" :config="selected.props"
@change-props="handleChangeProps" />
</FormItem>
</template> |
蛮好的,改动也蛮大,这个issue #15 也希望能够自定义,加这些功能目前没有完整的单元测试会更累,单元测试覆盖率高一些做这些事情会容易省心一些,接下来我尽可能把测试覆盖率加上去 |
拖拽热点从左上角按钮,调整到整个组件