Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
罗超
SuperMan
Commits
3afe5f0b
Commit
3afe5f0b
authored
Apr 24, 2023
by
沈良进
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save
parent
99084eea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
1 deletion
+33
-1
SignName.vue
src/components/SignName.vue
+33
-1
No files found.
src/components/SignName.vue
View file @
3afe5f0b
...
...
@@ -3,7 +3,7 @@
.SignName
.CanvasDiv
{
width
:
100%
;
height
:
calc
(
100%
-
8rem
);
padding-top
:
5%
;
padding-top
:
20px
;
}
.SignName
.CanvasDiv
#canvas
{
width
:
100%
;
...
...
@@ -103,6 +103,7 @@
</
template
>
<
script
>
import
tripBusOrderVue
from
'./busManagement/tripBusOrder.vue'
;
let
canvas
=
document
.
createElement
(
"canvas"
);
let
cxt
=
canvas
.
getContext
(
"2d"
);
export
default
{
...
...
@@ -165,6 +166,37 @@ export default {
}.
bind
(
this
),
false
);
//开始绘制
canvas
.
addEventListener
(
"mousedown"
,
function
(
e
)
{
this
.
isMouseDown
=
tripBusOrderVue
cxt
.
beginPath
();
cxt
.
lineWidth
=
linewidth
;
//当前线条的宽度,以像素计
cxt
.
moveTo
(
e
.
pageX
-
20
,
e
.
pageY
-
20
);
}.
bind
(
this
),
false
);
//绘制中
canvas
.
addEventListener
(
"mousemove"
,
function
(
e
)
{
if
(
this
.
isMouseDown
)
{
cxt
.
lineTo
(
e
.
pageX
-
20
,
e
.
pageY
-
20
);
cxt
.
stroke
();
}
}.
bind
(
this
),
false
);
//结束绘制
canvas
.
addEventListener
(
"mouseup"
,
function
()
{
this
.
isMouseDown
=
false
cxt
.
closePath
();
}.
bind
(
this
),
false
);
},
handelClearEl
()
{
cxt
.
clearRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
);
...
...
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