list.vue 795 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <div class="flex w-full flex-col items-center justify-center">
  3. <h1 class="my-[20px] font-black text-[30px]">
  4. {{title}}
  5. </h1>
  6. <div class="w-[1000px]">
  7. <p v-html="list">
  8. </p>
  9. </div>
  10. </div>
  11. </template>
  12. <script lang="ts" setup>
  13. import axios from 'axios'
  14. let list = ref('')
  15. let title =ref('')
  16. const postListIDFn = async () => {
  17. localStorage.getItem('hryk-id')
  18. // console.log('localStorage.getItem',localStorage.getItem('hryk-id'))
  19. let z: any = await axios.get(`https://official.webapi.bicredit.xin/api/news/detail/${localStorage.getItem('hryk-id')}`)
  20. console.log('zzz', z)
  21. // if(z.msg == '成功'){
  22. list.value = z.data.data.content
  23. title.value =z.data.data.title
  24. // console.log('list',list.value)
  25. // }
  26. }
  27. postListIDFn()
  28. </script>