随笔分类 - vue
摘要:最近在做一个有关监听scroll的功能, 发现我添加监听之后一直不起作用: mounted() { window.addEventListener("scroll", this.setHeadPosition); //this.setHeadPosition方法名 }, 后来发现要在后面添加一个tr
阅读全文
摘要:一、安装依赖 使用vue封装的vue-awesome-swiper轮播图插件,不是原生的swiper插件 安装,npm install vue-awesome-swiper@4.1.1 --save npm install swiper@5 --save 在main.js全局注册 import Vu
阅读全文
摘要:学习连接;http://wmm66.com/index/article/detail/id/193.html
阅读全文
摘要:现在我们安装 vue-router 版本的时候,默认还是安装的 3.x 版本的,由于 vue3 的更新发生很大的变化,所以为了兼容处理,vue-router 也将发布最新版 4.x 版本了 学习连接:http://wmm66.com/index/article/detail/id/224.html
阅读全文
摘要:今天用webpack打包项目,安装了less-loader模块之后报错,如下图: 原因: less-loader安装的版本过高解决方案: 1.npm uninstall stylus-loader2.npm install stylus-loader@3.0.2 --save-dev
阅读全文
摘要:下面看下vue component动态组件(详情看vue.js官网动态组件) 动态组件 通过component标签 的is属性来进行组件的切换 is的属性值决定要显示的组件,所以将is的属性值设置为data中的值,以便于动态变化 1 2 3 4 5 6 7 <template> <div class
阅读全文
摘要:用该属性获取页面 URL 地址(http://localhost:8080/?id=12345&a=b#/sellers): window.location 对象所包含的属性 属性描述 hash 从井号 (#) 开始的 URL(锚) host 主机名和当前 URL 的端口号 hostname 当前
阅读全文
摘要:better-scroll是一个页面滚动插件,用它可以很方便的实现下拉刷新,锚点滚动等功能。 实现原理:父容器固定高度,并设置overflow:hidden,子元素超出父元素高度后将被隐藏,超出部分可滚动且没有滚动条。 立即使用: <body> <div id="wrapper" ref="wrap
阅读全文
摘要:v-on:before-enter=“beforeEnter”入场动画之前执行beforeEnter方法 v-on:enter=“enter”入场过程中执行的方法 v-on:after-enter=“afterEnter”入场后执行的方法 v-on:after-leave=“afterLeave”离
阅读全文
摘要:点击路由连接(router-link), 默认有个 "router-link-active", 在router配置, 点击路由连接,让active类名与router-link-active"关联,active自动生效 <div> <!-- 头部 --> <v-headers></v-headers>
阅读全文
摘要:vue-cli3或者4中使用脚手架创建的项目,没有webpack.base.config.js文件,那么咋搞? 手动创建呗? 就可以配置一些额外的操作了,如何配置别名呢,直接上手吧。 创建vue.config.js文件 const path = require('path');//引入path模块
阅读全文
摘要:一,当点击点餐,评价,商家,路由组件时,会发送请求,我们需要点击一次时,对之前一个路由组件进行缓存,用到keep-alive 主要用于保留组件状态或避免重新渲染。 <template> <div> <ShopHeader></ShopHeader> <div class="tab"> <div cl
阅读全文
摘要:一,评价shopRtings页面搭建 在vuex中获取数据,商家评价列表数据 mounted(){ this.$store.dispatch('getShopRatings') }, computed:{ ...mapState(['info', 'ratings']) } 填充数据, 根据rate
阅读全文
摘要:一,搭建商品详情信息页面 注;新建shop路由组件,然后点击点餐的路由子组件(shopgoods),点击评价的路由子组件(shopratings),点击商家的路由子组件(shopInfo),顶部有个固定组件(shopheader) 在views中新建shop组件,再建shopgoods子组件,sho
阅读全文
摘要:一,shopList组件,从store获取数据,填充模板 mounted() { this.$store.dispatch('getShops') }, computed: { ...mapState(['shops']) } 二,使用svg显示加载中提示页面,如果数据还没回来,可用svg图片过渡下
阅读全文
摘要:一,首页页面情况 1.底部四个切换栏路由组件路由配置 import Vue from 'vue' import VueRouter from 'vue-router' Vue.use(VueRouter) // 引入路由组件 import Msite from '@/views/Msite' imp
阅读全文
摘要:1. 生成打包报告 2. 第三方库启用 CDN 3. Element-UI 组件按需加载 4. 路由懒加载 5. 首页内容定制 一,利用nprogress插件添加导航进度条 1.1安装;npm install --save nprogress 1,2 // 导入 NProgress 包对应的JS和C
阅读全文
摘要:一,订单管理中订单列表页面搭建 1.1,order订单组件路由配置 import Order from '@/views/Order/Order' { path: '/home', component: Home, // 重定向 redirect: '/welcome', children: [ {
阅读全文
摘要:vue-quill-editor github地址:https://github.com/surmon-china/vue-quill-editor 官方文档地址:https://www.npmjs.com/package/vue-quill-editor vue项目中,npm安装依赖 npm in
阅读全文
摘要:一,商品管理的商品列表页面搭建 1.1,商品列表组件路由配置 import List from '@/views/Goods/List' { path: '/home', component: Home, // 重定向 redirect: '/welcome', children: [ { path
阅读全文

浙公网安备 33010602011771号