11 2022 档案

摘要:路径配置 当springboot中设置项目访问路径 server.servlet.context-path=/demo vue项目中vue.config.js需配置publicPath module.exports = { transpileDependencies: true, configure 阅读全文
posted @ 2022-11-30 21:49 iTao0128 阅读(332) 评论(0) 推荐(0) 编辑
摘要:vue.config.js文件中 module.exports = { configureWebpack: { resolve: { alias: { 'assets': '@/assets', 'common': '@/common', 'components': '@/components', 阅读全文
posted @ 2022-11-29 11:28 iTao0128 阅读(85) 评论(0) 推荐(0) 编辑
摘要:1、首页:查看本地是否有.ssh文件找到 Git Bash 打开后 运行 cd ~/.ssh 查看是否有该文件如果本地有ssh密钥的话会有id_rsa、id_rsa.pub、known_hosts等文件。如果没有的话运行上步骤命令就会找不到文件的提示2、也可以删除ssh复制并运行 rm -rf ~/ 阅读全文
posted @ 2022-11-28 22:36 iTao0128 阅读(1788) 评论(0) 推荐(0) 编辑
摘要:通过vuecli3创建项目 vue create mall 新建远程仓库 终端中执行命令 git remote add origin git@github.com:xxx/mall.git git push -u origin main 阅读全文
posted @ 2022-11-28 22:34 iTao0128 阅读(30) 评论(0) 推荐(0) 编辑
摘要:新建network文件夹及request.js import axios from 'axios' export function request(config){ //创建axios实例 const instance = axios.create({ baseURL: 'http://123.20 阅读全文
posted @ 2022-11-27 22:54 iTao0128 阅读(21) 评论(0) 推荐(0) 编辑
摘要:安装 npm install axios --save axios基本使用 axios({ url: 'http://123.207.32.32:8000/home/multidata', method: 'get'//不写默认get方式 }).then(res => { console.log(r 阅读全文
posted @ 2022-11-27 19:43 iTao0128 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-11-27 17:56 iTao0128 阅读(16) 评论(0) 推荐(0) 编辑
摘要:const obj = { name: '张三', age: 20, address: 'abc' } const {name,address} = obj; console.log(name); console.log(address); 数组的解构 const names = ["张三","李四 阅读全文
posted @ 2022-11-27 17:41 iTao0128 阅读(6) 评论(0) 推荐(0) 编辑
摘要:示例:修改state中info对象的name值 state: { info: {id: 1003, name: "kobe" } } actions: {//异步请求、方法写在actions里 aUpdateInfo(context,value){//{commit,state} setTimeou 阅读全文
posted @ 2022-11-27 11:53 iTao0128 阅读(18) 评论(0) 推荐(0) 编辑
摘要:有时候,需要从store中获取一些state变化之后的数据,这是可以放入getters中 下面例子:获取年龄大于20的学生数据 注: getters默认是不能传递参数的,如果希望传递参数,那么只能让getters本身返回一个函数 阅读全文
posted @ 2022-11-25 22:35 iTao0128 阅读(15) 评论(0) 推荐(0) 编辑
摘要:通过mutations修改state状态 mutations中的方法必须是同步方法 this.$store.commit('mutations中的方法') const store = new Vuex.Store({ state: { counter: 100 }, mutations: { //方 阅读全文
posted @ 2022-11-25 17:42 iTao0128 阅读(23) 评论(0) 推荐(0) 编辑
摘要:安装 npm install vuex --save 创建store文件夹及index.js文件 import Vue from 'vue' import Vuex from 'vuex' //1.安装插件 Vue.use(Vuex) //2.创建对象 const store = new Vuex. 阅读全文
posted @ 2022-11-25 15:52 iTao0128 阅读(16) 评论(0) 推荐(0) 编辑
摘要:使用方式 路径前面加上~ import方式导入不需要加~ 阅读全文
posted @ 2022-11-24 20:11 iTao0128 阅读(28) 评论(0) 推荐(0) 编辑
摘要:<template> <div class="tab-bar-item" @click="itemClick"> <div v-if="!isActive"><slot name="item-icon"></slot></div> <div v-else><slot name="item-icon- 阅读全文
posted @ 2022-11-23 22:40 iTao0128 阅读(43) 评论(0) 推荐(0) 编辑
摘要:keep-alive是vue内置组件,可以使被包含的组件保留状态,避免重新渲染 router-view也是一个组件,如果之间被包在keep-alive里面,所有路径被匹配到的视图组件都会被缓存 切换home组件时的created只会被执行一次,destroyed不会被执行,即始终保持组件活跃状态 k 阅读全文
posted @ 2022-11-21 22:30 iTao0128 阅读(155) 评论(0) 推荐(0) 编辑
摘要:参考文档: https://router.vuejs.org/zh/guide/advanced/navigation-guards.html 路由独享的守卫 进入路由之前回调 组件内的守卫 阅读全文
posted @ 2022-11-21 22:10 iTao0128 阅读(24) 评论(0) 推荐(0) 编辑
摘要:实现组件跳转时,浏览器标题更新 ①router的index.js文件中 routes配置添加meta属性 ②router.beforeEach方法 import Vue from 'vue' import VueRouter from 'vue-router' const Home = () => 阅读全文
posted @ 2022-11-20 22:08 iTao0128 阅读(102) 评论(0) 推荐(0) 编辑
摘要:通过query传递 使用$route获取query对象 通过代码跳转路由的方式传递参数 <template> <div id="app"> <router-link to="/home" tag="button" >首页</router-link> <router-link to="/about" 阅读全文
posted @ 2022-11-19 17:15 iTao0128 阅读(27) 评论(0) 推荐(0) 编辑
摘要:home路径下配置一个news和message子路径 import Vue from 'vue' import VueRouter from 'vue-router' const Home = () => import('../components/Home') const HomeNews = ( 阅读全文
posted @ 2022-11-19 16:05 iTao0128 阅读(54) 评论(0) 推荐(0) 编辑
摘要:推荐使用下面的方法 import Vue from 'vue' import VueRouter from 'vue-router' const Home = () => import('../components/Home') const About = () => import('../comp 阅读全文
posted @ 2022-11-19 12:36 iTao0128 阅读(18) 评论(0) 推荐(0) 编辑
摘要::to绑定参数 /:参数名,进行拼接参数 $route.params.参数名,取参数值 阅读全文
posted @ 2022-11-19 12:16 iTao0128 阅读(22) 评论(0) 推荐(0) 编辑
摘要:<template> <div id="app"> <button @click="toHome">首页</button> <button @click="toAbout">关于</button> <!-- 相当于占位符 --> <router-view></router-view> </div> 阅读全文
posted @ 2022-11-18 22:38 iTao0128 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-11-18 21:39 iTao0128 阅读(12) 评论(0) 推荐(0) 编辑
摘要:安装 npm install vue-router --save 路由映射配置 创建router文件夹 新建index.js vue实例中挂载router 使用路由 <router-link></router-link> <router-view></router-view> 默认首页(重定向) r 阅读全文
posted @ 2022-11-16 22:40 iTao0128 阅读(24) 评论(0) 推荐(0) 编辑
摘要:通过以下可以改变浏览器中的url 跳转到home路径下: location.hash='home' 跳转到about路径下: history.pushState({},'','about') 向上回退: history.back() 向前进: history.forward() 使用test路径替换 阅读全文
posted @ 2022-11-16 20:57 iTao0128 阅读(15) 评论(0) 推荐(0) 编辑
摘要:1. 安装element-ui npm i element-ui -S 2. main.js中配置 //1.导入组件库 import ElementUI from 'element-ui' //2.导入组件样式相关 import 'element-ui/lib/theme-chalk/index.c 阅读全文
posted @ 2022-11-03 21:44 iTao0128 阅读(562) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示