提交 9902fe95 编写于 作者: X xiesi

添加axios

Signed-off-by: Nxiesi <305492881@qq.com>
上级 cd2e5152
......@@ -2503,6 +2503,14 @@
"integrity": "sha1-1h9G2DslGSUOJ4Ta9bCUeai0HFk=",
"dev": true
},
"axios": {
"version": "0.21.1",
"resolved": "https://registry.npm.taobao.org/axios/download/axios-0.21.1.tgz?cache=0&sync_timestamp=1608609188013&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faxios%2Fdownload%2Faxios-0.21.1.tgz",
"integrity": "sha1-IlY0gZYvTWvemnbVFu8OXTwJsrg=",
"requires": {
"follow-redirects": "^1.10.0"
}
},
"babel-eslint": {
"version": "10.1.0",
"resolved": "https://registry.npm.taobao.org/babel-eslint/download/babel-eslint-10.1.0.tgz?cache=0&sync_timestamp=1611946177416&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-eslint%2Fdownload%2Fbabel-eslint-10.1.0.tgz",
......@@ -5633,8 +5641,7 @@
"follow-redirects": {
"version": "1.14.1",
"resolved": "https://registry.nlark.com/follow-redirects/download/follow-redirects-1.14.1.tgz?cache=0&sync_timestamp=1620555429589&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffollow-redirects%2Fdownload%2Ffollow-redirects-1.14.1.tgz",
"integrity": "sha1-2RFN7Qoc/dM04WTmZirQK/2R/0M=",
"dev": true
"integrity": "sha1-2RFN7Qoc/dM04WTmZirQK/2R/0M="
},
"for-in": {
"version": "1.0.2",
......@@ -11289,6 +11296,11 @@
"@vue/shared": "3.0.11"
}
},
"vue-axios": {
"version": "3.2.4",
"resolved": "https://registry.npm.taobao.org/vue-axios/download/vue-axios-3.2.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-axios%2Fdownload%2Fvue-axios-3.2.4.tgz",
"integrity": "sha1-IzQVjbisKg9gOqQxwmJvv212ZyQ="
},
"vue-eslint-parser": {
"version": "7.6.0",
"resolved": "https://registry.npm.taobao.org/vue-eslint-parser/download/vue-eslint-parser-7.6.0.tgz",
......
......@@ -8,10 +8,12 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"element-plus": "^1.0.2-beta.45",
"three": "^0.128.0",
"vue": "^3.0.0",
"vue-axios": "^3.2.4",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.0-0"
},
......
import { createApp } from "vue";
import {
createApp
} from "vue";
import Home from "./views/Home.vue";
import router from "./router";
import store from "./store";
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import axios from 'axios'
import VueAxios from 'vue-axios'
createApp(Home).use(store).use(router).use(ElementPlus).mount("#app");
createApp(Home).use(store).use(router).use(ElementPlus).use(VueAxios, axios).mount("#app");
\ No newline at end of file
......@@ -35,7 +35,7 @@
</el-button>
</el-header>
<el-main> hello </el-main>
<el-main> <el-button @click="onclickaxios"> hello</el-button> </el-main>
</el-container>
</el-container>
......@@ -65,6 +65,12 @@ export default {
console.log("click : " + this.curefbxname); // ! 打印信息 审查自己name是否正确
this.drawer = true; // 打开`抽屉`控件
},
onclickaxios() {
console.log("nihao");
this.axios.get("http://localhost:8070").then((response) => {
console.log(response.data);
});
},
},
data() {
return {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册