UNPKG

vant-fork

Version:

Lightweight Mobile UI Components built on Vue

22 lines (19 loc) 528 B
/** * Create a basic component with common options */ import {default as locale} from '../locale/index'; import bem from '../mixins/bem'; import i18n from '../mixins/i18n'; import { isDef } from './'; var install = function install(Vue) { Vue.component(this.name, this); }; export default function (sfc) { sfc.name = 'van-' + sfc.name; sfc.install = sfc.install || install; sfc.mixins = sfc.mixins || []; sfc.mixins.push(i18n, bem); sfc.methods = sfc.methods || {}; sfc.methods.isDef = isDef; return sfc; };