Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cd43aca4
authored
Sep 06, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
上传组件
1 parent
c38d6bcd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
src/views/contentManager/components/preview/index.vue
src/views/contentManager/packageConfig/edit.vue
src/views/contentManager/components/preview/index.vue
View file @
cd43aca
...
...
@@ -69,7 +69,13 @@
>
<i
class=
"el-icon-plus avatar-uploader-desc-icon"
></i>
<div
class=
"avatar-uploader-desc-word"
>
上传
{{
picOptions
.
type
==
"video"
?
"视频"
:
"图片"
}}
上传
{{
picOptions
.
noLimitType
?
""
:
picOptions
.
type
==
"video"
?
"视频"
:
"图片"
}}
</div>
<input
type=
"file"
...
...
@@ -77,8 +83,14 @@
class=
"upload-img"
:style=
"
{ width: picOptions.width, height: picOptions.height }"
style="opacity: 0; z-index: -1"
:accept="picOptions.type == 'video' ? '.mp4' : '.jpg, .jpeg, .png,'"
@change="(e) => handleImgChange(e)"
:accept="
picOptions.noLimitType
? '*'
: picOptions.type == 'video'
? '.mp4'
: '.jpg, .jpeg, .png,'
"
@change="(e) => handleUpload(e)"
/>
</div>
</
template
>
...
...
@@ -161,6 +173,14 @@ export default {
}
this
.
$refs
.
uploadImgRef
.
click
()
},
handleUpload
(
e
)
{
console
.
log
(
e
.
srcElement
.
files
[
0
].
type
)
if
(
this
.
picOptions
.
noLimitType
)
{
if
(
e
.
srcElement
.
files
[
0
].
type
.
indexOf
(
"mp4"
)
>
-
1
)
this
.
picOptions
.
type
=
"video"
}
this
.
handleImgChange
(
e
)
},
// 上传图片
handleImgChange
(
e
)
{
var
file
=
e
.
srcElement
.
files
[
0
]
...
...
src/views/contentManager/packageConfig/edit.vue
View file @
cd43aca
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
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 post a comment