Skip to content

Commit

Permalink
feat: add delHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
Liberty-liu committed Apr 1, 2023
1 parent 34650df commit 03120f2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 27 deletions.
1 change: 1 addition & 0 deletions examples/views/formEditor/objEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const quickImages = ref([
'/public/Everright-logo.svg',
'/public/Everright-logo.svg'
])
</script>
<template>
<div
Expand Down
1 change: 1 addition & 0 deletions packages/formEditor/components/Sector/selectElement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export default {
const index = type !== 5 && props.parent.indexOf(props.data)
switch (type) {
case 1:
if (ER.props.delHandle(props.data) === false) return false
props.data.context.delete()
utils.deepTraversal(props.data, (node) => {
if (utils.checkIsField(node)) {
Expand Down
4 changes: 4 additions & 0 deletions packages/formEditor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const props = defineProps(_.merge({
blockPanelDefaultOpeneds: {
type: Array,
default: () => ['defaultField', 'field', 'container']
},
delHandle: {
type: Function,
default: () => {}
}
}, defaultProps))
const layout = {
Expand Down
27 changes: 0 additions & 27 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export default defineConfig({
define: { 'process.env.NODE_ENV': '"production"' },
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, 'packages/formEditor/index.js'),
name: 'Everright-formEditor',
formats: ['es', 'umd'],
Expand All @@ -83,10 +82,6 @@ export default defineConfig({
find: 'vuedraggable',
replacement: isProduction ? 'vuedraggable/src/vuedraggable' : 'vuedraggable'
},
// {
// find: 'editor',
// replacement: resolve(__dirname, 'packages/formEditor')
// },
{
find: '@ER',
replacement: resolve(__dirname, 'packages')
Expand All @@ -95,42 +90,20 @@ export default defineConfig({
find: '@ER-examples',
replacement: resolve(__dirname, 'examples')
}
// {
// find: '@ER-FILTER',
// replacement: resolve(__dirname, 'packages', 'filter')
// },
// {
// find: '@ER-REGION',
// replacement: resolve(__dirname, 'packages', 'region')
// },
// {
// find: '@ER-ICON',
// replacement: resolve(__dirname, 'packages', 'icon')
// }
]
},
plugins: [
// backend,
examplePlugin(),
svgLoader(),
vue(),
eslintPlugin({
include: ['src/**/*.js', 'src/**/*.vue', 'src/*.js', 'src/*.vue']
}),
vueJsx({
// options are passed on to @vue/babel-plugin-jsx
})
],
css: {
preprocessorOptions: {
// scss: {
// additionalData: `
// @use 'sass:math';
// @use 'sass:map';
// @use '/packages/theme/base.scss' as *;
// @use '/packages/theme/icon';
// `
// }
scss: {
additionalData: `
@use 'sass:math';
Expand Down

0 comments on commit 03120f2

Please sign in to comment.