import { defineComponent, ref, watch, type VNodeRef } from 'vue' import useGameNews from './useDiscountStore' import { RiTimeLine } from 'oh-vue-icons/icons' import { addIcons, OhVueIcon } from 'oh-vue-icons' import { IoCloseCircleOutline, RiCloseCircleLine } from 'oh-vue-icons/icons' import dayjs from 'dayjs' import useDiscountStore from './useDiscountStore' addIcons(RiTimeLine, IoCloseCircleOutline, RiCloseCircleLine) export default defineComponent(() => { const store = useDiscountStore() const containerRef = ref(null as VNodeRef | null) const searchText = ref('') const handleScroll = () => { const container = containerRef.value if (container.scrollTop + container.clientHeight >= container.scrollHeight - 50) { store.getNews() } } return () => (
{ searchText.value = e.target.value }} onKeydown={(e: any) => { if (e.key === 'Enter') { store.getNews() } }} >
{store.list.map((item, index) => { return (
{ }} key={index} >
{item.name}
{item.typename}
-13%
¥{item.commdity[0]?.price} ¥{item.commdity[0]?.oldprice} 剩余{item.commdity[0]?.oldprice}天
) })}
{store.loading && (
加载中...
)} {store.noMoreData && (
无更多数据
)}
) })