Commit c7e432f7e3b73c2bf84c9619270d8d4b2a9be848
1 parent
32e8393a
update export & i18n
Showing
2 changed files
with
76 additions
and
4 deletions
Show diff stats
src/index.js
| ... | ... | @@ -150,4 +150,78 @@ if (typeof window !== 'undefined' && window.Vue) { |
| 150 | 150 | install(window.Vue); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | -module.exports = Object.assign(iview, {install, locales}); // eslint-disable-line no-undef | |
| 153 | +// module.exports = Object.assign(iview, {install, locales}); // eslint-disable-line no-undef | |
| 154 | +module.exports = { // eslint-disable-line no-undef | |
| 155 | + version: '2.6.0', | |
| 156 | + locale: locale.use, | |
| 157 | + i18n: locale.i18n, | |
| 158 | + install, | |
| 159 | + locales, | |
| 160 | + Affix, | |
| 161 | + Alert, | |
| 162 | + AutoComplete, | |
| 163 | + Avatar, | |
| 164 | + BackTop, | |
| 165 | + Badge, | |
| 166 | + Breadcrumb, | |
| 167 | + BreadcrumbItem: Breadcrumb.Item, | |
| 168 | + Button, | |
| 169 | + ButtonGroup: Button.Group, | |
| 170 | + Card, | |
| 171 | + Carousel, | |
| 172 | + CarouselItem: Carousel.Item, | |
| 173 | + Cascader, | |
| 174 | + Checkbox, | |
| 175 | + CheckboxGroup: Checkbox.Group, | |
| 176 | + Circle, | |
| 177 | + Col, | |
| 178 | + Collapse, | |
| 179 | + ColorPicker, | |
| 180 | + DatePicker, | |
| 181 | + Dropdown, | |
| 182 | + DropdownItem: Dropdown.Item, | |
| 183 | + DropdownMenu: Dropdown.Menu, | |
| 184 | + Form, | |
| 185 | + FormItem: Form.Item, | |
| 186 | + Icon, | |
| 187 | + Input, | |
| 188 | + InputNumber, | |
| 189 | + Scroll, | |
| 190 | + LoadingBar, | |
| 191 | + Menu, | |
| 192 | + MenuGroup: Menu.Group, | |
| 193 | + MenuItem: Menu.Item, | |
| 194 | + Submenu: Menu.Sub, | |
| 195 | + Message, | |
| 196 | + Modal, | |
| 197 | + Notice, | |
| 198 | + Option: Option, | |
| 199 | + OptionGroup, | |
| 200 | + Page, | |
| 201 | + Panel: Collapse.Panel, | |
| 202 | + Poptip, | |
| 203 | + Progress, | |
| 204 | + Radio, | |
| 205 | + RadioGroup: Radio.Group, | |
| 206 | + Rate, | |
| 207 | + Row, | |
| 208 | + Select, | |
| 209 | + Slider, | |
| 210 | + Spin, | |
| 211 | + Step: Steps.Step, | |
| 212 | + Steps, | |
| 213 | + Switch, | |
| 214 | + Table, | |
| 215 | + Tabs: Tabs, | |
| 216 | + TabPane: Tabs.Pane, | |
| 217 | + Tag, | |
| 218 | + Timeline, | |
| 219 | + TimelineItem: Timeline.Item, | |
| 220 | + TimePicker, | |
| 221 | + Tooltip, | |
| 222 | + Transfer, | |
| 223 | + Tree, | |
| 224 | + Upload | |
| 225 | +}; | |
| 226 | + | |
| 227 | +module.exports.default = module.exports; // eslint-disable-line no-undef | |
| 154 | 228 | \ No newline at end of file | ... | ... |
src/locale/index.js
| 1 | -// https://github.com/ElemeFE/element/blob/dev/src/locale/index.js | |
| 2 | - | |
| 3 | 1 | import defaultLang from './lang/zh-CN'; |
| 4 | 2 | import Vue from 'vue'; |
| 5 | 3 | import deepmerge from 'deepmerge'; |
| ... | ... | @@ -10,7 +8,7 @@ let lang = defaultLang; |
| 10 | 8 | let merged = false; |
| 11 | 9 | let i18nHandler = function() { |
| 12 | 10 | const vuei18n = Object.getPrototypeOf(this || Vue).$t; |
| 13 | - if (typeof vuei18n === 'function') { | |
| 11 | + if (typeof vuei18n === 'function' && !!Vue.locale) { | |
| 14 | 12 | if (!merged) { |
| 15 | 13 | merged = true; |
| 16 | 14 | Vue.locale( | ... | ... |