摘要: script代码 data() { return { toShow5: false, scale_3: '0' }; }, mounted() { window.addEventListener('scroll', this.handleScrollx, true); window.addEvent 阅读全文
posted @ 2022-11-18 10:40 小闫的姑娘 阅读(96) 评论(0) 推荐(0) 编辑
摘要: script代码(不推荐:不适配) data() { return { toShow3:false, }; } mounted() { window.addEventListener('scroll', this.handleScrollx, true); }, methods: { handleS 阅读全文
posted @ 2022-11-17 11:24 小闫的姑娘 阅读(945) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-11-10 14:50 小闫的姑娘 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 安装依赖 cnpm install --save vuex 在src目录下新建一个store文件夹,文件夹内放置一个index.js文件,引入vue,vuex,使用插件 在main.js里引入store,需要全局挂载 1 import Vue from 'vue' 2 import App from 阅读全文
posted @ 2022-10-25 17:57 小闫的姑娘 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 安装依赖 cnpm install --save nprogress 1 import axios from "axios"; 2 3 // 引入进度条 4 import nprogress from 'nprogress'; 5 // 引入进度条css样式 6 import "nprogress/ 阅读全文
posted @ 2022-10-24 16:42 小闫的姑娘 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 在vue.config.js里写代码解决跨域问题 1 module.exports={ 2 productionSourceMap:false, 3 // 关闭eslint 4 lintOnSave:false, 5 //配置代理跨域 6 devServer:{ 7 proxy:{ 8 "/api" 阅读全文
posted @ 2022-10-24 15:04 小闫的姑娘 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 1 // 对axios进行二次封装 2 import axios from "axios" 3 // 利用axios对象的create方法,去创建一个axios实例 4 // request就是axios,只不过稍微配置了一下 5 const requests = axios.create({ 6 阅读全文
posted @ 2022-10-24 11:15 小闫的姑娘 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 第一步:给需要注册的全局组件取个name 1 <script> 2 export default { 3 name: "TypeNav" 4 } 5 </script> 第二部在main.js里引入 1 // 三级联动路由组件 2 import TypeNav from '@/pages/Home/ 阅读全文
posted @ 2022-10-24 10:04 小闫的姑娘 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 在router.js里书写代码 1 let originPush = VueRouter.prototype.push; 2 let originReplace = VueRouter.prototype.replace; 3 //VueRouter.prototype原型对象添加一个方法 4 // 阅读全文
posted @ 2022-10-24 09:56 小闫的姑娘 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 1 methods: { 2 //搜索按钮的回调 3 goSearch() { 4 //路由的跳转,采用的是编程式导航. 5 //路由传递参数 6 7 //第一种传递query参数 8 // this.$router.push({path:'/search',query:{keyword:this. 阅读全文
posted @ 2022-10-24 08:56 小闫的姑娘 阅读(19) 评论(0) 推荐(0) 编辑