moment
时间格式化库
import moment from "moment";
moment(item.endTime).format("YYYY-MM-DD")
//要在data里
moment: moment
lodash
常用的js函数库,封装,网址:https://www.lodashjs.com/
import _ from "lodash";
_.each(keyValues, function (kv, index) {
aTd.field.push({
key: skus_field[index],
value: kv,
type: 'text',
require: true
});
});
vue-clipboard2
剪切板复制的作用
<div
v-clipboard:copy="feed.content.text"
v-clipboard:success="onCopy"
v-clipboard:error="onError">复制文案</div>
vue-lazyload
图片懒加载
import VueLazyload from 'vue-lazyload';
Vue.use(VueLazyload, {
preLoad: 1.3,
error: '/static/images/img_error.jpeg',
loading: '/static/images/img_loading.png',
attempt: 1
});
<img v-lazy="img" cut="700w_350h" alt="" />
vue-video-player
一个非常强大的video播放组件,地址:https://github.surmon.me/vue-video-player/
vue-upload-component
文件上传组件,非常好用
exif-js
这个插件的作用是获取照片元信息,例如倾斜角度,通常可以用来处理部分ios机型拍照上传图片是斜着的问题,注意该插件只在手机上才有用,图片元信息只有手机长传的才带有
import EXIF from 'exif-js'
EXIF.getData(image,function () {
//具体处理
})
animate.css
强大的动画库
superagent
SuperAgent是一个轻量级、灵活的、易读的、低学习曲线的客户端请求代理模块,使用在NodeJS环境中