diff --git a/build/webpack.base.config.js b/build/webpack.base.config.js index 80ed082b..bfa9574d 100644 --- a/build/webpack.base.config.js +++ b/build/webpack.base.config.js @@ -22,7 +22,8 @@ module.exports = { plugins: [ 'syntax-dynamic-import', 'transform-decorators-legacy', - 'transform-class-properties' + 'transform-class-properties', + ["component", { "libraryName": "element-ui", "styleLibraryName": "~client/theme" } ] ] } }, diff --git a/client/element.js b/client/element.js new file mode 100644 index 00000000..377c4937 --- /dev/null +++ b/client/element.js @@ -0,0 +1,158 @@ +import Vue from 'vue'; + +/* +import ElementUI from 'element-ui'; +import './theme/index.css'; +import locale from 'element-ui/lib/locale/lang/ru-RU'; + +Vue.use(ElementUI, { locale }); +*/ + +//------------------------------------------------------ +import locale from 'element-ui/lib/locale/lang/ru-RU'; + +import { +// Pagination, +// Dialog, +// Autocomplete, +// Dropdown, +// DropdownMenu, +// DropdownItem, + Menu, +// Submenu, + MenuItem, +/* MenuItemGroup, + Input, + InputNumber, + Radio, + RadioGroup, + RadioButton, + Checkbox, + CheckboxButton, + CheckboxGroup, + Switch, + Select, + Option, + OptionGroup,*/ + Button, +/* ButtonGroup, + Table, + TableColumn, + DatePicker, + TimeSelect, + TimePicker, + Popover, + Tooltip, + Breadcrumb, + BreadcrumbItem, + Form, + FormItem,*/ + Tabs, + TabPane, + /*Tag, + Tree, + Alert, + Slider, + Icon, + Row, + Col, + Upload, + Progress, + Badge, + Card, + Rate, + Steps, + Step, + Carousel, + CarouselItem, + Collapse, + CollapseItem, + Cascader, + ColorPicker, + Transfer,*/ + Container, +// Header, + Aside, + Main, +// Footer, +// Loading, +// MessageBox, +// Message, + Notification +} from 'element-ui'; + +//Vue.use(Pagination); +//Vue.use(Dialog); +//Vue.use(Autocomplete); +//Vue.use(Dropdown); +//Vue.use(DropdownMenu); +//Vue.use(DropdownItem); +Vue.use(Menu); +//Vue.use(Submenu); +Vue.use(MenuItem); +/*Vue.use(MenuItemGroup); +Vue.use(Input); +Vue.use(InputNumber); +Vue.use(Radio); +Vue.use(RadioGroup); +Vue.use(RadioButton); +Vue.use(Checkbox); +Vue.use(CheckboxButton); +Vue.use(CheckboxGroup); +Vue.use(Switch); +Vue.use(Select); +Vue.use(Option); +Vue.use(OptionGroup);*/ +Vue.use(Button); +/*Vue.use(ButtonGroup); +Vue.use(Table); +Vue.use(TableColumn); +Vue.use(DatePicker); +Vue.use(TimeSelect); +Vue.use(TimePicker); +Vue.use(Popover); +Vue.use(Tooltip); +Vue.use(Breadcrumb); +Vue.use(BreadcrumbItem); +Vue.use(Form); +Vue.use(FormItem);*/ +Vue.use(Tabs); +Vue.use(TabPane); +/*Vue.use(Tag); +Vue.use(Tree); +Vue.use(Alert); +Vue.use(Slider); +Vue.use(Icon); +Vue.use(Row); +Vue.use(Col); +Vue.use(Upload); +Vue.use(Progress); +Vue.use(Badge); +Vue.use(Card); +Vue.use(Rate); +Vue.use(Steps); +Vue.use(Step); +Vue.use(Carousel); +Vue.use(CarouselItem); +Vue.use(Collapse); +Vue.use(CollapseItem); +Vue.use(Cascader); +Vue.use(ColorPicker); +Vue.use(Transfer);*/ +Vue.use(Container); +//Vue.use(Header); +Vue.use(Aside); +Vue.use(Main); +//Vue.use(Footer); + +//Vue.use(Loading.directive); + +//Vue.prototype.$loading = Loading.service; +//Vue.prototype.$msgbox = MessageBox; +//Vue.prototype.$alert = MessageBox.alert; +//Vue.prototype.$confirm = MessageBox.confirm; +//Vue.prototype.$prompt = MessageBox.prompt; +Vue.prototype.$notify = Notification; +//Vue.prototype.$message = Message; + +Vue.prototype.$ELEMENT = { locale }; \ No newline at end of file diff --git a/client/main.js b/client/main.js index 3329b1e9..a30075e7 100644 --- a/client/main.js +++ b/client/main.js @@ -3,15 +3,10 @@ import App from './components/App.vue'; import router from './router'; import store from './store'; - -import ElementUI from 'element-ui'; -import './theme/index.css'; -import locale from 'element-ui/lib/locale/lang/ru-RU'; +import './element'; //Vue.config.productionTip = false; -Vue.use(ElementUI, { locale }); - new Vue({ router, store, diff --git a/package-lock.json b/package-lock.json index 87e811a4..4534d99f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,6 +54,35 @@ "@babel/types": "^7.0.0" } }, + "@babel/helper-module-imports": { + "version": "7.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.35.tgz", + "integrity": "sha512-vaC1KyIZSuyWb3Lj277fX0pxivyHwuDU4xZsofqgYAbkDxNieMg2vuhzP5AgMweMY7fCQUMTi+BgPqTLjkxXFg==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.35", + "lodash": "^4.2.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.0.0-beta.35", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.35.tgz", + "integrity": "sha512-y9XT11CozHDgjWcTdxmhSj13rJVXpa5ZXwjjOiTedjaM0ba5ItqdS02t31EhPl7HtOWxsZkYCCUNrSfrOisA6w==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.2.0", + "to-fast-properties": "^2.0.0" + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + } + } + }, "@babel/helper-split-export-declaration": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", @@ -956,6 +985,15 @@ "babel-runtime": "^6.22.0" } }, + "babel-plugin-component": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-component/-/babel-plugin-component-1.1.1.tgz", + "integrity": "sha512-WUw887kJf2GH80Ng/ZMctKZ511iamHNqPhd9uKo14yzisvV7Wt1EckIrb8oq/uCz3B3PpAW7Xfl7AkTLDYT6ag==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "7.0.0-beta.35" + } + }, "babel-plugin-syntax-async-functions": { "version": "6.13.0", "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", diff --git a/package.json b/package.json index 41239759..d0fbe04c 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "babel-core": "^6.22.1", "babel-eslint": "^10.0.1", "babel-loader": "^7.1.1", + "babel-plugin-component": "^1.1.1", "babel-plugin-syntax-dynamic-import": "^6.18.0", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.5",