You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.4 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<script setup>
import DraggableButton from "@/pages/components/goHome.vue";
/**
* name
* usersa0ChunLuyu
* date2024年9月12日 20:01:39
*/
import {
ref
} from 'vue'
import {
$api,
$response
} from '@/api'
import {
onShow
} from '@dcloudio/uni-app'
import {
useStore
} from '@/store'
import List1 from './src/list1.vue'
import List2 from './src/list2.vue'
const $store = useStore()
const $props = defineProps({
type: {
type: Number,
default: 1
}
});
const posts = ref([])
const getArticleList = async () => {
const response = await $api('ArticleGetList', {
type: Number($props.type)
})
$response(response, () => {
posts.value = response.data.list
})
}
const mountedAction = () => {
getArticleList()
}
const config_ref = ref(null)
const configRef = (e) => {
if (!config_ref.value) {
config_ref.value = e
mountedAction()
}
}
onShow(() => {
if (!!config_ref.value) {
mountedAction()
}
})
</script>
<template>
<DraggableButton />
<view>
<view v-if="!!$store.config">
<view :ref="configRef"></view>
</view>
<view>
<view v-if="[1,2].includes(Number($props.type))">
<List1 :list="posts" :type="Number($props.type)"></List1>
</view>
<view v-if="[3].includes(Number($props.type))">
<List2 :list="posts" :type="Number($props.type)"></List2>
</view>
</view>
</view>
</template>
<style scoped>
</style>