feat:添加接口

This commit is contained in:
sundongyu 2024-05-26 19:37:12 +08:00
parent 83be95aff8
commit 55619df6f2
2 changed files with 10 additions and 2 deletions

View File

@ -95,7 +95,8 @@
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import { ref, onMounted } from 'vue'
import { posttListAPI } from '../api/index'
const data = ref([ const data = ref([
{ {
text: '全部' text: '全部'
@ -113,10 +114,17 @@ const data = ref([
text: '生活服务' text: '生活服务'
} }
]) ])
const posttList = async () => {
const arr = await posttListAPI({ id: '', category: '', name: '', tags: '', status: '' })
console.log(arr)
}
const dataIndex = ref(0) const dataIndex = ref(0)
function click (index) { function click (index) {
dataIndex.value = index dataIndex.value = index
} }
onMounted(() => {
posttList()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -120,7 +120,7 @@ const block = () => {
router.push('/about') router.push('/about')
} }
onMounted(() => { onMounted(() => {
posttListAPI({ id: '', category: '', name: '', tags: '', status: '' }) // posttListAPI({ id: '', category: '', name: '', tags: '', status: '' })
getList() getList()
}) })
</script> </script>