![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue插件集合
文章平均质量分 54
ThatITs
写bug
展开
-
处理时间戳的一些公共方法
时间戳的处理方法原创 2022-09-19 10:09:56 · 242 阅读 · 1 评论 -
vue插件集合25:删除全部的console
1:在开发中显示console.log打包后不显示console.log路径:build/webpack.prod.conf.js原创 2022-02-24 14:18:09 · 1490 阅读 · 0 评论 -
vue插件集合19:vue将时间戳转换成日期格式
(1)创建一个处理时间格式的js,内容如下:export function formatDate(date, fmt) { if (/(y+)/.test(fmt)) { fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)) } let o = { 'M...原创 2019-06-07 17:42:19 · 1427 阅读 · 0 评论 -
vue插件集合14:vant的按需引用
1:npm install vant --save2:cnpm i babel-plugin-import -D3:修改.babelrc文件为下面样子{ "presets": [ ["env", { "modules": false, "targets": { "browsers": ["> 1%", "la原创 2019-02-28 10:57:45 · 1252 阅读 · 3 评论 -
vue插件集合9:vue的tab切换 以及底部栏
1:vue中手机号的验证方式 用的vant框架1:模板中<div class="Info"> <i class="iconfont icon-shouji"></i> <input v-model="moblie" class="inputNum" type="number" value="&原创 2019-05-08 17:04:31 · 1326 阅读 · 0 评论 -
vue插件集合11:vue 自定义顶部栏组件
<template> <div class="goBack"> <div class="goBackTop"> <img class="back" @click="goback" src="static/images/my/searchCoin/fan@2x.png" alt=""> <div class="text">...原创 2019-04-26 09:47:32 · 511 阅读 · 0 评论 -
vue插件集合15:vue 组件传递参数的方法以及事件方法
1:创建公共的子组件template:<view class="listCon" v-for="item in list"> <view class="listwd flexbox"> <view class="vipwd">{{item.name}}</view> <view class="vipwd">{{item.vip}}</view> <view>{{item.num}}&原创 2020-06-29 15:28:39 · 497 阅读 · 0 评论 -
vue插件集合17:vue获取国家以及地区的方法
<template> <div class="atnight"> <div class="topseach"> <form action="/"> <van-search v-model="searchVal" :placeholder="$t('auth.count')" show-action @search="onS...原创 2019-06-22 15:51:54 · 7523 阅读 · 0 评论 -
vue插件集合18:vue实现长按删除方法
1:template中<div v-for="(item,index) in arr" :key="item.id" @touchstart.prevent="touchinUk(index)" @touchend.prevent="cleartime(index)"> <div> <p>{{item.address}}&l原创 2019-03-11 11:55:30 · 5841 阅读 · 4 评论 -
vue插件集合20:vue三种路由引用以及路由守卫
1:这是最常见一种 route的方式import home from "./home.vue";import about from "./about.vue";export default new Router({ routes: [ {path: '/home ',name: 'home ',component: home ,meta: {title: 'home',require...原创 2019-06-25 09:27:32 · 14486 阅读 · 1 评论 -
vue插件集合23:vue中axios的封装
1:axios的封装import axios from 'axios'import {Toast} from 'vant';// 引用vuex 来判断 token import store from '../store/store.js'// 创建 axios 实例export const Axios = axios.create({ baseURL: 'https://ont...原创 2019-03-26 11:19:35 · 378 阅读 · 0 评论 -
vue插件集合24:获取token,存到header中,后台验签token
1:从接口处拿到token以此接口为例子this.$http.post(&quot;/api/account/login/&quot;, { account: this.moblie, password: this.password, captcha_image: this.icodenum }) .then(res =&amp;gt; { consol.log(res.data.data....原创 2019-03-12 10:40:42 · 5471 阅读 · 1 评论 -
vue插件应用实列集合
1:animate.css的应用2:jwt的解密应用3:监听安卓手机的物理返回键 mui4:vue复制的功能5:vue生成二维码6:vue前端生成验证码7:获取验证码的方法8:vue项目中简单的px到rem的换算单位1:animate.css的应用1:npm install animate.css --save2:main.jsmain.js中import animated from 'animate.css';Vue.use(animated);== 3:应用==<d原创 2021-01-12 11:35:38 · 719 阅读 · 0 评论 -
vue插件集合12:vue中判断是iOS,安卓,以及微信的方法
模板中: 其中,img是一张图片,在微信中提示打开浏览器下载&amp;lt;div id=&quot;showad&quot; v-show=&quot;ShowDark&quot;&amp;gt; &amp;lt;div class=&quot;pop&quot;&amp;gt; &amp;lt;img class=&原创 2019-02-14 09:23:19 · 6138 阅读 · 1 评论 -
vue插件集合13:vuex的超级简单的应用
第一步 安装vuexnpm install vuex --save第二步 新建store目录在新建的store的目录下 新建 index.js文件 如下:import Vue from 'vue'import vuex from 'vuex'Vue.use(vuex);export default new vuex.Store({ state: { //变量名成 ethnum...原创 2019-01-09 14:09:20 · 213 阅读 · 0 评论 -
vue插件集合10:vue中的tab底部栏
<template> <div class="login"> <!-- 底部导航部分 --> <div id="TabBar" class="tab-bar row"> <div class="cell-3 tab-bar-item" @click="goPage(0)"原创 2019-02-12 13:53:38 · 414 阅读 · 0 评论 -
vue插件集合21:vue i18n做国际化切换中英文
1:安装需要的插件npm install vue-i18nnpm install js-cookie2:创建多语言的文件夹和js文件我是在src下创建了lang级目录,然后新建了zh.js,en.js,lang.js 三个js文件lang.js文件内容export default { setLang(lang) { window.localStorage.setItem('language', lang) }, getLang(defaultLang) { let localLa原创 2021-01-12 10:59:24 · 465 阅读 · 0 评论 -
vue插件集合16:vue前端生成图片验证码包含验证
1:创建组件的文件(简单粗暴上代码,方便复制)<template> <div class="s-canvas"> <canvas id="s-canvas" :width="contentWidth" :height="contentHeight"></canvas> </div></template>&...原创 2020-04-30 10:58:14 · 2581 阅读 · 6 评论 -
vue插件集合22:vue 简单粗暴,复制粘贴改变跨域
1:找到config下面的index.js 在dev下面的proxyTable添加如下'/': { target: 'http://www.zgddyc.com.cn/api/', //你要访问的服务器域名 changeOrigin: true, //允许跨域 pathRewrite: { '^/': '' }...原创 2020-04-17 09:13:08 · 241 阅读 · 0 评论