Advertising.vue 949 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <!-- 广告位 -->
  3. <div class="adversing">
  4. <div class="inner">
  5. <img src="../../static/images/Group 1538.png" alt="">
  6. </div>
  7. <p>{{ message }}</p>
  8. </div>
  9. </template>
  10. <script setup>
  11. import { onMounted } from 'vue'
  12. const nuxtApp = useNuxtApp();
  13. const axios = nuxtApp.$axios;
  14. // const props = defineProps({
  15. // message: String
  16. // });
  17. let image = useState("image", () => "")
  18. let getWebsiteAdvertisement = async () => {
  19. try {
  20. const response = await axios.get(`/web/getWebsiteAdvertisement?adPlace=${9}`);
  21. console.log(response);
  22. image.value = response.data;
  23. } catch (error) {
  24. console.error(error);
  25. }
  26. }
  27. onMounted(() => {
  28. getWebsiteAdvertisement()
  29. })
  30. </script>
  31. <style lang="less">
  32. // 广告位logo
  33. .adversing {
  34. width: 100%;
  35. height: 90px;
  36. margin: 60px 0 60px;
  37. img {
  38. width: 1200px;
  39. height: 90px;
  40. }
  41. }
  42. </style>