1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <template>
- <div :class="['message-input-button', !isPC && 'message-input-button-h5']">
- <button
- v-if="props.enableSend"
- class="message-input-button-cont"
- data-type="text"
- :disabled="false"
- @click="sendMessage"
- >
- <p class="message-input-button-hover">
- {{ TUITranslateService.t("TUIChat.按Enter发送,Ctrl+Enter换行") }}
- </p>
- {{ TUITranslateService.t("发送") }}
- </button>
- </div>
- </template>
- <script setup lang="ts">
- import { TUITranslateService } from '@tencentcloud/chat-uikit-engine';
- import { isPC } from '../../../utils/env';
- const props = defineProps({
- enableSend: {
- type: Boolean,
- default: true,
- },
- });
- const emits = defineEmits(['sendMessage']);
- const sendMessage = () => {
- emits('sendMessage');
- };
- </script>
- <style scoped lang="scss">
- @import "../../../assets/styles/common";
- .message-input-button {
- position: absolute;
- bottom: 20px;
- right: 20px;
- &-h5 {
- position: static;
- }
- &-cont {
- padding: 8px 20px;
- border-radius: 4px;
- border: none;
- font-size: 14px;
- text-align: center;
- line-height: 20px;
- font-weight: 400;
- background: #006eff;
- color: #fff;
- letter-spacing: 0;
- cursor: pointer;
- }
- &-hover {
- display: none;
- justify-content: center;
- align-items: center;
- position: absolute;
- right: 120%;
- word-break: keep-all;
- height: 30px;
- white-space: nowrap;
- top: 0;
- bottom: 0;
- margin: auto 0;
- padding: 5px 10px;
- border-radius: 3px;
- background: #000;
- color: #fff;
- opacity: 0.3;
- &::before {
- content: "";
- position: absolute;
- width: 0;
- height: 0;
- right: -20px;
- border: 10px solid transparent;
- border-left: 10px solid #000;
- }
- }
- &:hover {
- .message-input-button-hover {
- display: flex;
- }
- }
- }
- </style>
|