随笔分类 -  前端

摘要:恢复内容开始 【get】 带param参数和请求头 方式1 axios({ method: "get", url: this.api + "/getstudent", params: { limit: 1, size: 5, }, }) .then((res) => { // 登陆失败 consol 阅读全文
posted @ 2022-02-28 20:52 Hello霖 阅读(319) 评论(0) 推荐(0)
摘要:import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export default new Vuex.Store({ // 存储数据 state: { school:"卢本伟nb", age:18, gender:"man" }, / 阅读全文
posted @ 2022-02-28 10:34 Hello霖 阅读(387) 评论(0) 推荐(0)
摘要:简单获取写法: <template> <div>{{ $store.state.school}}</div> </template> 每次都需要填写 【$store.state.xxx】 快速获取写法: <script> import { mapState } from "vuex"; export 阅读全文
posted @ 2022-02-28 10:22 Hello霖 阅读(679) 评论(0) 推荐(0)
摘要:1.store目录下的index.js用来存储数据和方法 import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export default new Vuex.Store({ // 存储数据 state: { school:"卢本伟大 阅读全文
posted @ 2022-02-28 10:07 Hello霖 阅读(1598) 评论(0) 推荐(0)
摘要:1.推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用。 npm i element-ui -S 2.main.js中加入 import ElementUI from 'element-ui'; import 'element-ui/lib/theme-chalk/inde 阅读全文
posted @ 2022-02-27 19:36 Hello霖 阅读(125) 评论(0) 推荐(0)