Skip to content

Commit

Permalink
feat: update package version to "1.3.0-beta.1" and enhance form edito…
Browse files Browse the repository at this point in the history
…r layout
  • Loading branch information
Liberty-liu committed Jan 18, 2024
1 parent d9eefdd commit 2cdf6cb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "everright-formeditor",
"version": "1.2.3",
"version": "1.3.0-beta.1",
"description": "🦮 Powerful lowcode|vue form editor,generator,designer,builder library. It provides an easy way to create custom forms. The project is extensible, easy to use and configure, and provides many commonly used form components and functions(vue可视化低代码表单设计器、表单编辑器、element-plus vant表单设计)",
"files": [
"dist",
Expand Down
5 changes: 2 additions & 3 deletions packages/formEditor/components/Panels/Canves/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default defineComponent({
isEditModel,
isPc
} = hooks.useTarget()
const form = ref('')
const handleClick = (e) => {
setSelection('root')
}
Expand All @@ -27,12 +26,12 @@ export default defineComponent({
const Layout = (<LayoutDragGable data-layout-type={'root'} class={[unref(isEditModel) && ns.e('wrap')]} data={state.store} parent={state.store} isRoot></LayoutDragGable>)
return (
<div>
<TagComponent ref={form} onClick={unref(isEditModel) && handleClick} {...typeProps.value}>
<TagComponent ref={ER.form} onClick={unref(isEditModel) && handleClick} {...typeProps.value}>
{
unref(isEditModel) ? Layout : Layout
}
</TagComponent>
{!unref(isEditModel) && !_.isEmpty(state.config) && ER.props.isShowCompleteButton && <CompleteButton handle={form}/>}
{!unref(isEditModel) && !_.isEmpty(state.config) && ER.props.isShowCompleteButton && <CompleteButton handle={ER.form}/>}
</div>
)
}
Expand Down
5 changes: 4 additions & 1 deletion packages/formEditor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const layout = {
pc: [],
mobile: []
}
const form = ref('')
const previewPlatform = ref('pc')
const previewLoading = ref(true)
const state = reactive({
Expand Down Expand Up @@ -391,6 +392,7 @@ const getData = () => {
}
const setData = props.layoutType === 1 ? setData1 : setData2
defineExpose({
form,
switchPlatform (platform) {
switchPlatform(platform)
},
Expand Down Expand Up @@ -461,7 +463,8 @@ provide('Everright', {
addFieldData,
canvesScrollRef,
fireEvent,
getData
getData,
form
})
</script>
<template>
Expand Down
7 changes: 5 additions & 2 deletions packages/formEditor/preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const layout = {
pc: [],
mobile: []
}
const form = ref('')
const state = reactive({
store: [],
selection: {},
Expand Down Expand Up @@ -67,7 +68,8 @@ provide('Everright', {
getData,
props,
fireEvent,
setValue
setValue,
form
})
const setData2 = (data, value) => {
const newData = _.cloneDeep(data)
Expand Down Expand Up @@ -129,7 +131,8 @@ defineExpose({
state.platform = platform
},
setData,
getData
getData,
form
})
</script>
<template>
Expand Down

0 comments on commit 2cdf6cb

Please sign in to comment.