Commit 076e4451 authored by Yuan Zhixiang's avatar Yuan Zhixiang
Browse files

修改指令前缀

parent 20713ac9
......@@ -14,7 +14,7 @@ const css_grid_template_columns = computed(() => {
return `repeat(${total_steps.value}, 1fr)`;
})
const command_available = computed(()=>{
return stdin_input.value.startsWith("/set ")
return stdin_input.value.startsWith("/")
})
......
......@@ -5,24 +5,25 @@ import { computed, inject } from 'vue';
const { stdin_input, feature_show_new_vars } = inject('app')
const command = computed(()=>{
if(stdin_input.value.length <= 5){
if(stdin_input.value.length <= 1){
return ''
}else{
return stdin_input.value.slice(5)
return stdin_input.value.slice(1)
}
})
function click(){
const cmd = command.value
if(cmd == 'help'){
stdin_input.value = 'available commands:\n/set show_new_vars'
console.log(cmd)
if(cmd == '?'){
stdin_input.value = 'available commands:\n/show_new_vars'
}
else if(cmd == 'show_new_vars'){
feature_show_new_vars.value = !feature_show_new_vars.value
stdin_input.value = 'feature_show_new_vars: ' + feature_show_new_vars.value
}
else{
stdin_input.value = 'unknown command\nuse /set help'
stdin_input.value = 'unknown command\nuse /?'
}
}
......
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