Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
38f50726
Commit
38f50726
authored
Apr 19, 2021
by
Vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(form): remove field binding when deleting schema #471
parent
b92b8a3c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
12 deletions
+8
-12
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
index.ts
build/vite/plugin/index.ts
+2
-2
useForm.ts
src/components/Form/src/hooks/useForm.ts
+1
-2
useFormEvents.ts
src/components/Form/src/hooks/useFormEvents.ts
+4
-1
README.md
src/components/Icon/README.md
+0
-7
No files found.
CHANGELOG.zh_CN.md
View file @
38f50726
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
-
修复黑暗主题刷新闪烁的白屏
-
修复黑暗主题刷新闪烁的白屏
-
修复标签页关闭其他功能失效问题
-
修复标签页关闭其他功能失效问题
-
修复表单已知问题
## 2.3.0 (2021-04-10)
## 2.3.0 (2021-04-10)
...
...
build/vite/plugin/index.ts
View file @
38f50726
...
@@ -16,7 +16,7 @@ import { configThemePlugin } from './theme';
...
@@ -16,7 +16,7 @@ import { configThemePlugin } from './theme';
import
{
configImageminPlugin
}
from
'
./imagemin
'
;
import
{
configImageminPlugin
}
from
'
./imagemin
'
;
import
{
configWindiCssPlugin
}
from
'
./windicss
'
;
import
{
configWindiCssPlugin
}
from
'
./windicss
'
;
import
{
configSvgIconsPlugin
}
from
'
./svgSprite
'
;
import
{
configSvgIconsPlugin
}
from
'
./svgSprite
'
;
//
import { configHmrPlugin } from './hmr';
import
{
configHmrPlugin
}
from
'
./hmr
'
;
export
function
createVitePlugins
(
viteEnv
:
ViteEnv
,
isBuild
:
boolean
)
{
export
function
createVitePlugins
(
viteEnv
:
ViteEnv
,
isBuild
:
boolean
)
{
const
{
const
{
...
@@ -35,7 +35,7 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
...
@@ -35,7 +35,7 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
];
];
// TODO
// TODO
//
!isBuild && vitePlugins.push(configHmrPlugin());
!
isBuild
&&
vitePlugins
.
push
(
configHmrPlugin
());
// @vitejs/plugin-legacy
// @vitejs/plugin-legacy
VITE_LEGACY
&&
isBuild
&&
vitePlugins
.
push
(
legacy
());
VITE_LEGACY
&&
isBuild
&&
vitePlugins
.
push
(
legacy
());
...
...
src/components/Form/src/hooks/useForm.ts
View file @
38f50726
...
@@ -77,8 +77,7 @@ export function useForm(props?: Props): UseFormReturnType {
...
@@ -77,8 +77,7 @@ export function useForm(props?: Props): UseFormReturnType {
},
},
removeSchemaByFiled
:
async
(
field
:
string
|
string
[])
=>
{
removeSchemaByFiled
:
async
(
field
:
string
|
string
[])
=>
{
const
form
=
await
getForm
();
unref
(
formRef
)?.
removeSchemaByFiled
(
field
);
form
.
removeSchemaByFiled
(
field
);
},
},
// TODO promisify
// TODO promisify
...
...
src/components/Form/src/hooks/useFormEvents.ts
View file @
38f50726
...
@@ -88,7 +88,9 @@ export function useFormEvents({
...
@@ -88,7 +88,9 @@ export function useFormEvents({
*/
*/
async
function
removeSchemaByFiled
(
fields
:
string
|
string
[]):
Promise
<
void
>
{
async
function
removeSchemaByFiled
(
fields
:
string
|
string
[]):
Promise
<
void
>
{
const
schemaList
:
FormSchema
[]
=
cloneDeep
(
unref
(
getSchema
));
const
schemaList
:
FormSchema
[]
=
cloneDeep
(
unref
(
getSchema
));
if
(
!
fields
)
return
;
if
(
!
fields
)
{
return
;
}
let
fieldList
:
string
[]
=
isString
(
fields
)
?
[
fields
]
:
fields
;
let
fieldList
:
string
[]
=
isString
(
fields
)
?
[
fields
]
:
fields
;
if
(
isString
(
fields
))
{
if
(
isString
(
fields
))
{
...
@@ -107,6 +109,7 @@ export function useFormEvents({
...
@@ -107,6 +109,7 @@ export function useFormEvents({
if
(
isString
(
field
))
{
if
(
isString
(
field
))
{
const
index
=
schemaList
.
findIndex
((
schema
)
=>
schema
.
field
===
field
);
const
index
=
schemaList
.
findIndex
((
schema
)
=>
schema
.
field
===
field
);
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
delete
formModel
[
field
];
schemaList
.
splice
(
index
,
1
);
schemaList
.
splice
(
index
,
1
);
}
}
}
}
...
...
src/components/Icon/README.md
deleted
100644 → 0
View file @
b92b8a3c
### `Icon.vue`
```
html
<Icon
icon=
"mdi:account"
/>
```
The icon id follows the rules in
[
Iconify
](
https://iconify.design/
)
which you can use any icons from the supported icon sets.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment