Skip to content

Commit 3367396

Browse files
committed
移动端响应式布局优化
1 parent 15a326e commit 3367396

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

resources/js/Pages/Chat.vue

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -100,29 +100,32 @@ const audioFailed = (error) => {
100100
<hr>
101101
<div class="p-4 bg-white px-4">
102102
<div class="pb-safe">
103-
<form class="flex items-start justify-center space-x-2 mb-2" @submit.prevent="chat">
103+
<form class="grid grid-cols-1 gap-2 md:flex md:items-start md:justify-center md:space-x-2 mb-2"
104+
@submit.prevent="chat">
104105
<textarea required id="chat-input-textbox" placeholder="输入你的问题..." name="prompt"
105106
autocomplete="off" v-model="form.prompt" style="height: 40px !important;"
106107
class="block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:py-1.5 sm:text-sm sm:leading-6"></textarea>
107-
<button
108-
:class="{ 'flex items-center justify-center px-4 py-2 border border-green-600 bg-green-500 hover:bg-green-600 text-white rounded-md text-sm md:text-base': true }"
109-
title="发送消息" type="submit">
110-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
111-
stroke="currentColor" class="w-6 h-6">
112-
<path stroke-linecap="round" stroke-linejoin="round"
113-
d="M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5" />
114-
</svg>
115-
</button>
116-
<audio-widget @audio-upload="audio" @audio-failed="audioFailed" />
117-
<button
118-
class="flex items-center justify-center px-4 py-2 border border-gray-500 bg-gray-400 hover:bg-gray-500 text-white rounded-md text-sm md:text-base"
119-
@click="reset" title="清空消息" type="button">
120-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
121-
stroke="currentColor" class="w-6 h-6">
122-
<path stroke-linecap="round" stroke-linejoin="round"
123-
d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
124-
</svg>
125-
</button>
108+
<div class="flex space-x-2">
109+
<button
110+
:class="{ 'flex items-center justify-center px-4 py-2 border border-green-600 bg-green-500 hover:bg-green-600 text-white rounded-md text-sm md:text-base': true }"
111+
title="发送消息" type="submit">
112+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
113+
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
114+
<path stroke-linecap="round" stroke-linejoin="round"
115+
d="M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5" />
116+
</svg>
117+
</button>
118+
<audio-widget @audio-upload="audio" @audio-failed="audioFailed" />
119+
<button
120+
class="flex items-center justify-center px-4 py-2 border border-gray-500 bg-gray-400 hover:bg-gray-500 text-white rounded-md text-sm md:text-base"
121+
@click="reset" title="清空消息" type="button">
122+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
123+
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
124+
<path stroke-linecap="round" stroke-linejoin="round"
125+
d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
126+
</svg>
127+
</button>
128+
</div>
126129
</form>
127130
</div>
128131
</div>

routes/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
|
1616
*/
1717

18-
Route::get('/', ChatController::class . '@index')->name('home')->middleware('cache.response');
18+
Route::get('/', ChatController::class . '@index')->name('home');
1919
Route::get('/messages', ChatController::class . '@messages')->name('messages');
2020
Route::post('/chat', ChatController::class . '@chat')->name('chat')->middleware('throttle:chat');
2121
Route::get('/stream', ChatController::class . '@stream')->name('stream');

0 commit comments

Comments
 (0)