Fri Jun 9 03:49:00 UTC 2023 inscode

上级 39fed091
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
</template> </template>
</div> </div>
<div class="question ivu-mt"> <div class="question ivu-mt">
<Input v-model="question" type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" placeholder="输入你的问题" /> <Input v-model="question" type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" placeholder="输入你的问题" @keydown.ctrl.enter="keyCtrlEnter" />
<Row class="ivu-mt"> <Row class="ivu-mt">
<Col> <Col>
<Button type="primary" size="large" icon="md-send" :loading="loading" @click="handleSend">发送</Button> <Button type="primary" size="large" icon="md-send" :loading="loading" @click="handleSend">发送(Ctrl+Enter)</Button>
</Col> </Col>
<Col> <Col>
<Button size="large" class="ivu-ml" icon="md-add" :disabled="loading" @click="handleNewChat">新对话</Button> <Button size="large" class="ivu-ml" icon="md-add" :disabled="loading" @click="handleNewChat">新对话</Button>
...@@ -33,6 +33,10 @@ export default { ...@@ -33,6 +33,10 @@ export default {
} }
}, },
methods: { methods: {
//Ctrl + enter按键 发生消息
keyCtrlEnter(e){
this.handleSend()
},
handleSend() { handleSend() {
if (this.loading || this.question === '') return; if (this.loading || this.question === '') return;
this.loading = true; this.loading = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册