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
53326d81
Commit
53326d81
authored
Apr 30, 2024
by
Yuan Zhixiang
Browse files
添加步骤超限提示
parent
91422663
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/components/ControlPanel.vue
View file @
53326d81
...
...
@@ -8,6 +8,7 @@ import NextButton from './buttons/NextButton.vue';
import
CommandButton
from
'
./buttons/CommandButton.vue
'
;
import
NextBreakpoint
from
'
./buttons/NextBreakpoint.vue
'
;
import
PrevBreakpoint
from
'
./buttons/PrevBreakpoint.vue
'
;
import
WarningButton
from
'
./buttons/WarningButton.vue
'
;
const
{
total_steps
,
edit_mode
,
stdin_input
}
=
inject
(
'
app
'
)
...
...
@@ -17,6 +18,9 @@ const css_grid_template_columns = computed(() => {
const
command_available
=
computed
(()
=>
{
return
stdin_input
.
value
.
startsWith
(
"
/
"
)
})
const
too_many_steps
=
computed
(()
=>
{
return
total_steps
.
value
>=
1000
})
</
script
>
...
...
@@ -34,6 +38,7 @@ const command_available = computed(()=>{
<br
v-show=
"!edit_mode"
>
<PrevBreakpoint
v-show=
"!edit_mode"
/>
<NextBreakpoint
v-show=
"!edit_mode"
/>
<WarningButton
v-show=
"!edit_mode && too_many_steps"
/>
</div>
</
template
>
...
...
src/components/buttons/WarningButton.vue
0 → 100644
View file @
53326d81
<
script
setup
>
import
{
inject
}
from
'
vue
'
;
const
{
total_steps
}
=
inject
(
'
app
'
)
</
script
>
<
template
>
<button
class=
"button"
disabled
>
步骤数超限!
</button>
</
template
>
<
style
scoped
>
@import
'@/assets/button.css'
;
.button
{
color
:
red
;
}
.button
:hover
{
background-color
:
white
;
}
.button
:active
{
background-color
:
white
;
}
button
:disabled
{
opacity
:
1
;
}
</
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