12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <template>
- <!-- 广告位 -->
- <div class="adversing">
- <div class="inner">
- <a href="http://www.baidu.com">
- <!-- <img :src="imgurl.thumb" alt=""> -->
- <img :src="imgurl.thumb" v-if="!imgurl.image_src">
- <img :src="imgurl.image_src" v-if="imgurl.image_src">
- </a>
- </div>
- <p>{{ message }}</p>
- </div>
- </template>
- <script setup>
- import { onMounted } from 'vue'
- const nuxtApp = useNuxtApp();
- const axios = nuxtApp.$axios;
- const props = defineProps({
- imgurl: String
- });
- let image = useState("image", () => "")
- let getWebsiteAdvertisement = async () => {
- try {
- const response = await axios.get(`/web/getWebsiteAdvertisement?adPlace=${9}`);
- console.log(response);
- image.value = response.data;
- } catch (error) {
- console.error(error);
- }
- }
- onMounted(() => {
- getWebsiteAdvertisement()
- })
- </script>
- <style lang="less">
- // 广告位logo
- .adversing {
- width: 100%;
- height: 90px;
- margin: 60px 0 60px;
- img {
- width: 1200px;
- height: 90px;
- }
- }
- </style>
|