![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue2
lynnpaul
这个作者很懒,什么都没留下…
展开
-
VUE2.X使用Swiper5.x,并实现懒加载
安装Swiper5cnpm install swiper@5.4.5 vue-awesome-swiper --savemain.js引入import VueAwesomeSwiper from 'vue-awesome-swiper'//引入样式import 'swiper/css/swiper.css'Vue.use(VueAwesomeSwiper, /* { default options with global component } */)myswiper.vue组件使原创 2021-05-11 10:25:29 · 1520 阅读 · 0 评论 -
VUE动态绑定src图片地址
直接上代码,<template> <div class="block"> <span class="demonstration"></span> <el-carousel height="150px"> <el-carousel-item v-for="item in 4" :key="item"> <img height="150px" v-bind:sr原创 2021-04-09 11:11:24 · 1001 阅读 · 0 评论 -
vue路由通过props传参
vue路由通过props传参最近在学习vuerouter的传参,查询官网,作为小白真心有点看不懂,折腾了很久才搞懂最简单的一个方式,官网地址:https://router.vuejs.org/zh/guide/essentials/passing-props.html。网上查了蛮多资料,终于搞明白是什么情况,总结内容如下:非props方式传参:方式一:使用params传参路由配置 { path: '/propstest', name: 'PropsT.原创 2021-04-01 15:52:06 · 4136 阅读 · 2 评论 -
vue router路由的基本加载
1.安装,进入项目目录cnpm install --save vue-router2.引用,在main.js文件下引入import VueRouter from "vue-router";//引入路由组件import login from "./components/login";Vue.use(VueRouter)3.配置路由文件,在main.js文件中写入var router = new VueRouter({ routes:[{ path: "/",原创 2020-12-08 15:30:15 · 184 阅读 · 0 评论 -
VUE自定义吐司toast
一个在学习vue的小白,各种折腾,最近页面需要用到toast,故查了部分资料。使用toast有两个方式,一个是使用第三方插件(这个网上很多,大家可以自行搜索,上个链接供大家参考https://www.npmjs.com/package/vue2-toast);另一个方式是自定义一个toast,效果见下图:文件目录:index.js文件代码:import Vue from 'vue'import toast from './toast.vue'// 创建组件构造器con原创 2020-12-02 14:56:28 · 584 阅读 · 0 评论 -
VUE axios跨域问题解决
在使用axios进行接口请求的时候会存在跨域的问题,如果后端未限制的情况下,从前端出发,可是进行如下处理:一、在main.js文件中,导入模块,import axios from 'axios'Vue.prototype.$axios = axiosaxios.defaults.baseURL = '/api' //关键代码二、在项目中找到config文件夹下的index.js文件,打开后,找到dev:,在大括号里插入代码,位置要找对插入代码如下:dev:{........原创 2020-11-25 11:46:32 · 535 阅读 · 0 评论 -
vue2.x中使用animate.css
最近在学习VUE+animate.css,入门遇到一些坑。先上几个链接:animate.css官网:https://animate.style/#migration;animate.css下载地址:https://github.com/asika32764/vue2-animate;vue环境下使用animate.css:https://www.npmjs.com/package/vue2-animate;1.vue环境,安装animate.css模块:cnpm install vue原创 2020-11-10 11:47:20 · 1507 阅读 · 0 评论