import { computed, defineComponent, onMounted, ref } from 'vue' import useDiscountStore from './useDiscountStore' export default defineComponent(() => { const store = useDiscountStore() const idx = ref(0) const selectItem = computed(() => { return store.list[idx.value] }) onMounted(() => { setInterval(() => { idx.value = idx.value + 1 if (idx.value > store.list.length - 1) { idx.value = 0 } }, 5000) }) return () => (
-13%
剩余1天
{selectItem.value.name}
{selectItem.value.typename}
¥{selectItem.value.commdity[0]?.price} ¥{selectItem.value.commdity[0]?.oldprice}
) })