Skip to content

引入

ts
import { getVLazyOptions } from 't-comm';

// 不支持 tree-shaking 的项目
import { getVLazyOptions} from 't-comm/lib/v-lazy/index';

// 只支持 ESM 的项目
import { getVLazyOptions} from 't-comm/es/v-lazy/index';

getVLazyOptions(options)

描述:获取 vue-lazyload 插件参数

参数

参数名描述
options选项

返回: 插件参数

示例

ts
import Vue from 'vue';
import VueLazyload from 'vue-lazyload';
import { getVLazyOptions } from 't-comm';

Vue.use(VueLazyload, getVLazyOptions({
  loadingImg: '/loading.png',
  errorImg: '/error.png',
}));