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
16c5d327
Commit
16c5d327
authored
Jun 30, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(basic-upload): `value` support v-model
parent
76a5f87c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
BasicUpload.vue
src/components/Upload/src/BasicUpload.vue
+3
-1
No files found.
CHANGELOG.zh_CN.md
View file @
16c5d327
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
-
**Axios**
新增
`withToken`
配置,用于控制请求是否携带 token
-
**Axios**
新增
`withToken`
配置,用于控制请求是否携带 token
-
**BasicUpload**
新增在预览
`Modal`
中删除文件时触发
`preview-delete`
事件
-
**BasicUpload**
新增在预览
`Modal`
中删除文件时触发
`preview-delete`
事件
-
**BasicUpload**
`value`
支持
`v-model`
用法
### 🐛 Bug Fixes
### 🐛 Bug Fixes
...
...
src/components/Upload/src/BasicUpload.vue
View file @
16c5d327
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
name
:
'
BasicUpload
'
,
name
:
'
BasicUpload
'
,
components
:
{
UploadModal
,
UploadPreviewModal
,
Icon
,
Tooltip
},
components
:
{
UploadModal
,
UploadPreviewModal
,
Icon
,
Tooltip
},
props
:
uploadContainerProps
,
props
:
uploadContainerProps
,
emits
:
[
'
change
'
,
'
delete
'
,
'
preview-delete
'
],
emits
:
[
'
change
'
,
'
delete
'
,
'
preview-delete
'
,
'
update:value
'
],
setup
(
props
,
{
emit
,
attrs
})
{
setup
(
props
,
{
emit
,
attrs
})
{
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
...
@@ -85,12 +85,14 @@
...
@@ -85,12 +85,14 @@
// 上传modal保存操作
// 上传modal保存操作
function
handleChange
(
urls
:
string
[])
{
function
handleChange
(
urls
:
string
[])
{
fileList
.
value
=
[...
unref
(
fileList
),
...(
urls
||
[])];
fileList
.
value
=
[...
unref
(
fileList
),
...(
urls
||
[])];
emit
(
'
update:value
'
,
fileList
.
value
);
emit
(
'
change
'
,
fileList
.
value
);
emit
(
'
change
'
,
fileList
.
value
);
}
}
// 预览modal保存操作
// 预览modal保存操作
function
handlePreviewChange
(
urls
:
string
[])
{
function
handlePreviewChange
(
urls
:
string
[])
{
fileList
.
value
=
[...(
urls
||
[])];
fileList
.
value
=
[...(
urls
||
[])];
emit
(
'
update:value
'
,
fileList
.
value
);
emit
(
'
change
'
,
fileList
.
value
);
emit
(
'
change
'
,
fileList
.
value
);
}
}
...
...
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