Commit 53326d81 authored by Yuan Zhixiang's avatar Yuan Zhixiang
Browse files

添加步骤超限提示

parent 91422663
...@@ -8,6 +8,7 @@ import NextButton from './buttons/NextButton.vue'; ...@@ -8,6 +8,7 @@ import NextButton from './buttons/NextButton.vue';
import CommandButton from './buttons/CommandButton.vue'; import CommandButton from './buttons/CommandButton.vue';
import NextBreakpoint from './buttons/NextBreakpoint.vue'; import NextBreakpoint from './buttons/NextBreakpoint.vue';
import PrevBreakpoint from './buttons/PrevBreakpoint.vue'; import PrevBreakpoint from './buttons/PrevBreakpoint.vue';
import WarningButton from './buttons/WarningButton.vue';
const { total_steps, edit_mode, stdin_input } = inject('app') const { total_steps, edit_mode, stdin_input } = inject('app')
...@@ -17,6 +18,9 @@ const css_grid_template_columns = computed(() => { ...@@ -17,6 +18,9 @@ const css_grid_template_columns = computed(() => {
const command_available = computed(()=>{ const command_available = computed(()=>{
return stdin_input.value.startsWith("/") return stdin_input.value.startsWith("/")
}) })
const too_many_steps = computed(()=>{
return total_steps.value >= 1000
})
</script> </script>
...@@ -34,6 +38,7 @@ const command_available = computed(()=>{ ...@@ -34,6 +38,7 @@ const command_available = computed(()=>{
<br v-show="!edit_mode"> <br v-show="!edit_mode">
<PrevBreakpoint v-show="!edit_mode" /> <PrevBreakpoint v-show="!edit_mode" />
<NextBreakpoint v-show="!edit_mode" /> <NextBreakpoint v-show="!edit_mode" />
<WarningButton v-show="!edit_mode && too_many_steps" />
</div> </div>
</template> </template>
......
<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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment