4 changed files with 38 additions and 3 deletions
@ -1 +1,4 @@ |
|||
vue3 项目,主要用于展示VUE3的各种DEMO |
|||
|
|||
|
|||
> https://vue3js.cn/docs/zh/api/composition-api.html#setup |
@ -1,8 +1,14 @@ |
|||
import {onMounted,ref} from "vue" |
|||
import {request_} from "./request"; |
|||
|
|||
export default { |
|||
const fuck = { |
|||
install(app){ |
|||
app.provide("$http",fuck) |
|||
// app.config.globalProperties.$http = fuck;
|
|||
}, |
|||
bannerData: (data)=>request_("GET",'https://gank.io/api/v2/banners',data), |
|||
articleData: (data)=>request_("GET",'https://gank.io/api/v2/data/category/GanHuo/type/frontend/page/1/count/10',data), |
|||
articleDetail: (data)=>request_("GET",'https://gank.io/api/v2/post/'+data) |
|||
} |
|||
|
|||
export default fuck |
@ -1,13 +1,21 @@ |
|||
import {createApp} from 'vue' |
|||
import router from "./router/index" |
|||
import App from './App.vue' |
|||
import api from "./api/index" |
|||
import Header from "@/components/Header.vue" |
|||
import Image from "@/components/Image.vue" |
|||
import Mobile from "@/components/Mobile.vue" |
|||
|
|||
const app = createApp(App); |
|||
app.use(router); |
|||
app.use(api) |
|||
|
|||
app.config.globalProperties.name = 'xianyu' |
|||
|
|||
app.mount('#app') |
|||
app.component("Header",Header) |
|||
app.component("Image",Image) |
|||
app.component("Mobile",Mobile) |
|||
|
|||
|
|||
|
|||
|
Loading…
Reference in new issue