mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
[Improvement] extract component common part (#703)
This commit is contained in:
@@ -2,18 +2,24 @@
|
||||
* Create a component with common options
|
||||
*/
|
||||
import '../locale';
|
||||
import Icon from '../icon';
|
||||
import i18n from '../mixins/i18n';
|
||||
import install from './install';
|
||||
import Icon from '../icon';
|
||||
import Loading from '../loading';
|
||||
import Cell from '../cell';
|
||||
import CellGroup from '../cell-group';
|
||||
|
||||
export default function(sfc) {
|
||||
sfc.name = 'van-' + sfc.name;
|
||||
sfc.install = sfc.install || install;
|
||||
sfc.mixins = sfc.mixins || [];
|
||||
sfc.mixins.push(i18n);
|
||||
sfc.components = sfc.components || {};
|
||||
sfc.components.icon = Icon;
|
||||
sfc.components.loading = Loading;
|
||||
sfc.components = Object.assign(sfc.components || {}, {
|
||||
Icon,
|
||||
Loading,
|
||||
Cell,
|
||||
CellGroup
|
||||
});
|
||||
|
||||
return sfc;
|
||||
};
|
||||
|
Reference in New Issue
Block a user