feat: 首页数据
This commit is contained in:
@@ -2,51 +2,35 @@
|
||||
<view class="more-tips">
|
||||
<view class="more-tips-scroll">
|
||||
<view class="more-tips-item" v-for="(item, index) in itemList" :key="index">
|
||||
<text class="more-tips-item-title" @click="sendReply(item.title)">{{ item.title }}</text>
|
||||
<text class="more-tips-item-title" @click="sendReply(item)">{{ item }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
const itemList = ref([])
|
||||
import { defineProps } from "vue";
|
||||
const emits = defineEmits(['replySent']);
|
||||
|
||||
defineProps({
|
||||
itemList: {
|
||||
type: [],
|
||||
default: [
|
||||
'定温泉票',
|
||||
'定酒店',
|
||||
'优惠套餐',
|
||||
'亲子玩法',
|
||||
'了解交通',
|
||||
'看看酒店',
|
||||
'看看美食'
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const sendReply = (text) => {
|
||||
emits('replySent', text); // 向父组件传递数据
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
initData()
|
||||
})
|
||||
|
||||
const initData = () => {
|
||||
itemList.value = [
|
||||
{
|
||||
title: '定温泉票',
|
||||
},
|
||||
{
|
||||
title: '定酒店',
|
||||
},
|
||||
{
|
||||
title: '优惠套餐',
|
||||
},
|
||||
{
|
||||
title: '亲子玩法',
|
||||
},
|
||||
{
|
||||
title: '了解交通',
|
||||
},
|
||||
{
|
||||
title: '看看酒店',
|
||||
},
|
||||
{
|
||||
title: '看看美食',
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user