Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
byq_pc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张伯涛
byq_pc
Commits
e686c040
Commit
e686c040
authored
Apr 29, 2025
by
jiaxu.yan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
: 背景展示
parent
1685415d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
index.vue
src/views/index/index.vue
+2
-2
index.vue
src/views/makePie/index.vue
+7
-8
No files found.
src/views/index/index.vue
View file @
e686c040
...
...
@@ -40,7 +40,7 @@
第六视角
</button>
-->
</div>
<pie
ref=
"zutai"
:backgroundImage=
"pic1"
>
</pie>
<pie
ref=
"zutai"
:width=
"200"
:height=
"400"
:backgroundImage=
"pic1"
>
</pie>
</el-col>
</el-row>
</div>
...
...
@@ -128,4 +128,4 @@ export default {
font-size
:
20px
;
color
:
#000000
;
}
</
style
>
\ No newline at end of file
</
style
>
src/views/makePie/index.vue
View file @
e686c040
...
...
@@ -18,7 +18,7 @@
</div>
<div
class=
"canvas-container"
>
<!--
<img
:src=
"background
"
alt=
"Background"
style=
"width: 100%; height: 100%; position: absolute;z-index: 1;
"
>
-->
<!--
<img
:src=
"background
Image"
alt=
"Background"
:style=
"
{width: width,height:height,position:'absolute',zIndex:11}
"> -->
<canvas
ref=
"canvas"
:width=
"width"
...
...
@@ -362,13 +362,12 @@ export default {
return
`rgb(
${
r
}
,
${
g
}
,
${
b
}
)`
},
drawBackground
()
{
const
canvas
=
this
.
$refs
.
canvas
;
const
ctx
=
canvas
.
getContext
(
'2d'
);
const
image
=
new
Image
();
image
.
src
=
this
.
background
;
// 设置你的图片路径
image
.
onload
=
()
=>
{
ctx
.
drawImage
(
image
,
0
,
0
,
canvas
.
width
,
canvas
.
height
);
};
const
image
=
new
Image
()
image
.
src
=
this
.
backgroundImage
// 设置你的图片路径
const
self
=
this
image
.
onload
=
function
()
{
self
.
ctx
.
drawImage
(
image
,
0
,
0
,
self
.
width
,
self
.
height
)
}
},
// 清除所有
clearAll
()
{
...
...
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