feat: 调整首页组件目录结构
This commit is contained in:
45
pages/index/components/module/AttachListComponent/index.vue
Normal file
45
pages/index/components/module/AttachListComponent/index.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<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, defineEmits } from "vue";
|
||||
import { onMounted } from "vue";
|
||||
import { SCROLL_TO_BOTTOM } from "@/constant/constant";
|
||||
|
||||
const props = defineProps({
|
||||
question: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
|
||||
const tags = ref([]);
|
||||
const emits = defineEmits(["replySent"]);
|
||||
|
||||
const handleClick = (item) => {
|
||||
emits("replySent", 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>
|
||||
Reference in New Issue
Block a user