support i18n

support i18n
This commit is contained in:
梁灏 2017-01-11 18:04:29 +08:00
parent 86b4da54d4
commit d33b51432d
10 changed files with 151 additions and 15 deletions

View file

@ -40,6 +40,7 @@ import Tooltip from './components/tooltip';
import Transfer from './components/transfer';
import { Row, Col } from './components/layout';
import { Select, Option, OptionGroup } from './components/select';
import locale from './locale';
const iview = {
Affix,
@ -100,7 +101,10 @@ const iview = {
Transfer
};
const install = function (Vue) {
const install = function (Vue, opts = {}) {
locale.use(opts.locale);
locale.i18n(opts.i18n);
Object.keys(iview).forEach((key) => {
Vue.component(key, iview[key]);
});