• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
dafeiyunli
博客园    首页    新随笔    联系   管理    订阅  订阅
2021年6月10日
使用vuex
摘要: npm install vuex --save // yarn add vuex import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) import Vue from 'vue' import Vuex from 'vuex' imp 阅读全文
posted @ 2021-06-10 18:42 dafeiyunli 阅读(45) 评论(0) 推荐(0)
vue封装axios
摘要: yarn add axios --save //utils/request.js import axios from 'axios' import { getToken } from '@/utils/auth' import { Message } from 'element-ui' const 阅读全文
posted @ 2021-06-10 17:15 dafeiyunli 阅读(29) 评论(0) 推荐(0)
使用js-cookie存储token
摘要: yarn add js-cookie // utils/auth.js import Cookies from 'js-cookie' const TokenKey = 'Token' export function getToken() { return Cookies.get(TokenKey) 阅读全文
posted @ 2021-06-10 16:26 dafeiyunli 阅读(1027) 评论(0) 推荐(0)
vue引入element-ui
摘要: npm i element-ui -S import ElementUI from 'element-ui'; import 'element-ui/lib/theme-chalk/index.css'; Vue.use(ElementUI); <el-button type="primary">主 阅读全文
posted @ 2021-06-10 15:53 dafeiyunli 阅读(40) 评论(0) 推荐(0)
vue配置别名@符号
摘要: #vue.config.js 'use strict' const path = require('path') function resolve(dir) { // 配置别名 return path.join(__dirname, dir) } module.exports = { //... c 阅读全文
posted @ 2021-06-10 15:33 dafeiyunli 阅读(511) 评论(0) 推荐(0)
封装mock
摘要: #在mock目录下新建mock-server.js const chokidar = require('chokidar') const bodyParser = require('body-parser') const chalk = require('chalk') const path = r 阅读全文
posted @ 2021-06-10 15:08 dafeiyunli 阅读(144) 评论(0) 推荐(0)
vue2使用mockjs初体验
摘要: cnpm install mockjs --save-dev cnpm install axios --save #创建目录 const Mock = require('mockjs') module.exports = function(app) { app.get('/user/userinfo 阅读全文
posted @ 2021-06-10 12:57 dafeiyunli 阅读(461) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3