[improvement] Remove create & i18 mixin (#2670)
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
// component mixin
|
||||
import { get, camelize } from '../utils';
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
$t() {
|
||||
const { name } = this.$options;
|
||||
const prefix = name ? camelize(name) + '.' : '';
|
||||
|
||||
if (!this.$vantMessages) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.error('[Vant] Locale not correctly registered');
|
||||
}
|
||||
return () => '';
|
||||
}
|
||||
|
||||
const messages = this.$vantMessages[this.$vantLang];
|
||||
return (path, ...args) => {
|
||||
const message = get(messages, prefix + path) || get(messages, path);
|
||||
return typeof message === 'function' ? message(...args) : message;
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Create a basic component with common options
|
||||
*/
|
||||
import useSfc from './use/sfc';
|
||||
import useBem from './use/bem';
|
||||
import i18n from '../mixins/i18n';
|
||||
import { isDef } from '.';
|
||||
|
||||
export default function (sfc) {
|
||||
sfc = useSfc('van-' + sfc.name)(sfc);
|
||||
sfc.mixins = sfc.mixins || [];
|
||||
sfc.mixins.push(i18n);
|
||||
sfc.methods = sfc.methods || {};
|
||||
sfc.methods.isDef = isDef;
|
||||
sfc.methods.b = useBem(sfc.name);
|
||||
|
||||
return sfc;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Create a component with common options
|
||||
*/
|
||||
import createBasic from './create-basic';
|
||||
import Icon from '../icon';
|
||||
import Loading from '../loading';
|
||||
import Cell from '../cell';
|
||||
import CellGroup from '../cell-group';
|
||||
|
||||
export default function (sfc) {
|
||||
sfc.components = Object.assign(sfc.components || {}, {
|
||||
Icon,
|
||||
Loading,
|
||||
Cell,
|
||||
CellGroup
|
||||
});
|
||||
return createBasic(sfc);
|
||||
}
|
||||
Reference in New Issue
Block a user