feat: 调整了目录结构
This commit is contained in:
47
src/pages/ChatModule/AttachListComponent/index.vue
Normal file
47
src/pages/ChatModule/AttachListComponent/index.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<view class="tag-list">
|
||||
<view
|
||||
v-for="(item, index) in tags"
|
||||
:key="index"
|
||||
class="tag-item"
|
||||
@click="handleClick(item)"
|
||||
>
|
||||
<text class="tag-text">{{ item }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, nextTick } from "vue";
|
||||
import { onMounted } from "vue";
|
||||
import {
|
||||
SCROLL_TO_BOTTOM,
|
||||
SEND_MESSAGE_CONTENT_TEXT,
|
||||
} from "@/constant/constant";
|
||||
|
||||
const props = defineProps({
|
||||
question: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
|
||||
const tags = ref([]);
|
||||
|
||||
const handleClick = (item) => {
|
||||
uni.$emit(SEND_MESSAGE_CONTENT_TEXT, item);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
tags.value = props.question.split(/[&|;]/).filter((tag) => tag.trim() !== "");
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
uni.$emit(SCROLL_TO_BOTTOM, true);
|
||||
}, 300);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "./styles/index.scss";
|
||||
</style>
|
||||
23
src/pages/ChatModule/AttachListComponent/styles/index.scss
Normal file
23
src/pages/ChatModule/AttachListComponent/styles/index.scss
Normal file
@@ -0,0 +1,23 @@
|
||||
.tag-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
|
||||
.tag-item {
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #fff;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
border-radius: 8px;
|
||||
padding: 4px 10px;
|
||||
margin-right: 8px;
|
||||
margin-bottom: 8px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.tag-text {
|
||||
color: $theme-color-500;
|
||||
font-size: $uni-font-size-base;
|
||||
}
|
||||
Reference in New Issue
Block a user