基础准备
# 引入指令模块
在main.js文件下添加如下配置:
import {AsDirectives} from "as-common-plugins";
Vue.use(AsDirectives);
# 引入指令模块中某些指令
在main.js文件下添加如下配置:
import {
AsCopy,
AsDrag,
AsLongPress,
AsBacktop,
AsClickOutside,
AsEllipsis,
AsExpandClick,
AsFormat,
AsInputNumber,
AsProhibitEmoji,
AsTooltip,
AsScrollPop,
AsWaterMark,
AsLoadmore,
AsLoadmoreElTable,
AsLazyload,
AsResize,
AsDebounce,
AsThrottle
} from 'as-common-plugins';
Vue.use(AsCopy);//复制
Vue.use(AsDrag);//拖拽
Vue.use(AsLongPress);//长按
Vue.use(AsBacktop);//回到顶部
Vue.use(AsClickOutside);//点击外部
Vue.use(AsEllipsis);//省略号
Vue.use(AsExpandClick);//伸缩点击
Vue.use(AsFormat);//格式化
Vue.use(AsInputNumber);//数字输入
Vue.use(AsProhibitEmoji);//表情禁用
Vue.use(AsTooltip);//文本提示
Vue.use(AsScrollPop);//弹框滚动
Vue.use(AsWaterMark);//水印
Vue.use(AsLoadmore);//触底加载
Vue.use(AsLoadmoreElTable);//触底加载(针对el-table元素)
Vue.use(AsLazyload);//懒加载
Vue.use(AsResize);//响应缩放
Vue.use(AsDebounce);//防抖
Vue.use(AsThrottle);//节流