随笔分类 -  vue项目搭建

摘要:npm install ip -D const ip = require('ip') devServer: { port: 8082, host: ip.address(), // host: 'localhost', proxy: { '/api': { target: 'https://test 阅读全文
posted @ 2020-12-31 15:53 日升月恒 阅读(299) 评论(0) 推荐(0)
摘要:1、安装cross-env (cross-env能跨平台地设置及使用环境变量)cnpm/npm i cross-env -D 2、新建模板 红色的为相关文件 3、配置各个文件 (1)config下面的index.js 'use strict' // Template version: 1.3.1 / 阅读全文
posted @ 2020-11-23 11:43 日升月恒 阅读(1082) 评论(0) 推荐(0)
摘要:// encodeURI、encodeURIComponent、decodeURI、decodeURIComponent四个用来编码和解码 URI 的函数 // URL截取后面的字符串转换成对象 function GetStr() { var url = location.search; //获取u 阅读全文
posted @ 2020-03-26 16:19 日升月恒 阅读(830) 评论(0) 推荐(0)
摘要:router文件夹index.js import Vue from 'vue' import Router from 'vue-router' const login = r => require.ensure([], () => r(require('@/components/login.vue' 阅读全文
posted @ 2020-03-25 12:14 日升月恒 阅读(661) 评论(0) 推荐(0)
摘要:例:在src下面新建一个文件夹store,在store里新建文件夹modules和index.js,在modules里新建文件token.js,在token.js里做登录拦截 token.js export default { state: { token: null, title:'' }, mu 阅读全文
posted @ 2020-03-25 11:55 日升月恒 阅读(267) 评论(0) 推荐(0)
摘要:http.js import axios from 'axios'; import Qs from "qs" import store from '@/store/store' import router from '@/router/index' // 设置请求超时时间 https://www.k 阅读全文
posted @ 2020-03-25 11:35 日升月恒 阅读(1613) 评论(0) 推荐(0)