Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yuan Zhixiang
c-render-vue
Commits
c0ed4f9f
Commit
c0ed4f9f
authored
Apr 26, 2024
by
Yuan Zhixiang
Browse files
新增断点跳转
parent
c08ffd2e
Changes
5
Show whitespace changes
Inline
Side-by-side
src/assets/button.css
View file @
c0ed4f9f
...
...
@@ -5,6 +5,7 @@
padding
:
0.5rem
;
transition-duration
:
200ms
;
margin-right
:
0.8rem
;
margin-bottom
:
0.8rem
;
}
.button
:hover
{
...
...
src/components/ControlPanel.vue
View file @
c0ed4f9f
...
...
@@ -6,7 +6,8 @@ import RunButton from './buttons/RunButton.vue';
import
PrevButton
from
'
./buttons/PrevButton.vue
'
;
import
NextButton
from
'
./buttons/NextButton.vue
'
;
import
CommandButton
from
'
./buttons/CommandButton.vue
'
;
import
NextBreakpoint
from
'
./buttons/NextBreakpoint.vue
'
;
import
PrevBreakpoint
from
'
./buttons/PrevBreakpoint.vue
'
;
const
{
total_steps
,
edit_mode
,
stdin_input
}
=
inject
(
'
app
'
)
...
...
@@ -29,7 +30,9 @@ const command_available = computed(()=>{
<RunButton
v-show=
"edit_mode"
/>
<PrevButton
v-show=
"!edit_mode"
/>
<NextButton
v-show=
"!edit_mode"
/>
<CommandButton
v-show=
"command_available"
/>
<CommandButton
v-show=
"command_available && edit_mode"
/>
<NextBreakpoint
v-show=
"!edit_mode"
/>
<PrevBreakpoint
v-show=
"!edit_mode"
/>
</div>
</
template
>
...
...
src/components/buttons/EditButton.vue
View file @
c0ed4f9f
...
...
@@ -11,7 +11,7 @@ function click() {
</
script
>
<
template
>
<button
class=
"button"
@
click=
"click"
>
编辑
代码
</button>
<button
class=
"button"
@
click=
"click"
>
修改
代码
</button>
</
template
>
<
style
scoped
>
...
...
src/components/buttons/NextBreakpoint.vue
0 → 100644
View file @
c0ed4f9f
<
script
setup
>
import
{
inject
}
from
'
vue
'
;
const
{
current_step
,
highlight_steps
}
=
inject
(
'
app
'
)
function
click
()
{
let
target
let
success
=
false
let
distance
=
Infinity
for
(
let
element
of
highlight_steps
.
value
){
let
this_distance
=
element
-
current_step
.
value
if
(
this_distance
>
0
&&
this_distance
<
distance
){
distance
=
this_distance
target
=
element
success
=
true
}
}
if
(
success
){
current_step
.
value
=
target
}
}
</
script
>
<
template
>
<button
class=
"button"
@
click=
"click"
>
下个断点
</button>
</
template
>
<
style
scoped
>
@import
'@/assets/button.css'
;
</
style
>
\ No newline at end of file
src/components/buttons/PrevBreakpoint.vue
0 → 100644
View file @
c0ed4f9f
<
script
setup
>
import
{
inject
}
from
'
vue
'
;
const
{
current_step
,
highlight_steps
}
=
inject
(
'
app
'
)
function
click
()
{
let
target
let
success
=
false
let
distance
=
Infinity
for
(
let
element
of
highlight_steps
.
value
){
let
this_distance
=
current_step
.
value
-
element
if
(
this_distance
>
0
&&
this_distance
<
distance
){
distance
=
this_distance
target
=
element
success
=
true
}
}
if
(
success
){
current_step
.
value
=
target
}
}
</
script
>
<
template
>
<button
class=
"button"
@
click=
"click"
>
上个断点
</button>
</
template
>
<
style
scoped
>
@import
'@/assets/button.css'
;
</
style
>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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