浏览代码

Добавил импорт модулей по запросу из ElemenUI

Book Pauk 6 年之前
父节点
当前提交
02f34e1c26
共有 5 个文件被更改,包括 200 次插入7 次删除
  1. 2 1
      build/webpack.base.config.js
  2. 158 0
      client/element.js
  3. 1 6
      client/main.js
  4. 38 0
      package-lock.json
  5. 1 0
      package.json

+ 2 - 1
build/webpack.base.config.js

@@ -22,7 +22,8 @@ module.exports = {
                     plugins: [
                     plugins: [
                         'syntax-dynamic-import',
                         'syntax-dynamic-import',
                         'transform-decorators-legacy',
                         'transform-decorators-legacy',
-                        'transform-class-properties'
+                        'transform-class-properties',
+                        ["component", { "libraryName": "element-ui", "styleLibraryName": "~client/theme" } ]
                     ]
                     ]
                 }
                 }
             },
             },

+ 158 - 0
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 };

+ 1 - 6
client/main.js

@@ -3,15 +3,10 @@ import App from './components/App.vue';
 
 
 import router from './router';
 import router from './router';
 import store from './store';
 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.config.productionTip = false;
 
 
-Vue.use(ElementUI, { locale });
-
 new Vue({
 new Vue({
     router,
     router,
     store,
     store,

+ 38 - 0
package-lock.json

@@ -54,6 +54,35 @@
         "@babel/types": "^7.0.0"
         "@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": {
     "@babel/helper-split-export-declaration": {
       "version": "7.0.0",
       "version": "7.0.0",
       "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz",
       "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-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": {
     "babel-plugin-syntax-async-functions": {
       "version": "6.13.0",
       "version": "6.13.0",
       "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",
       "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",

+ 1 - 0
package.json

@@ -20,6 +20,7 @@
     "babel-core": "^6.22.1",
     "babel-core": "^6.22.1",
     "babel-eslint": "^10.0.1",
     "babel-eslint": "^10.0.1",
     "babel-loader": "^7.1.1",
     "babel-loader": "^7.1.1",
+    "babel-plugin-component": "^1.1.1",
     "babel-plugin-syntax-dynamic-import": "^6.18.0",
     "babel-plugin-syntax-dynamic-import": "^6.18.0",
     "babel-plugin-transform-class-properties": "^6.24.1",
     "babel-plugin-transform-class-properties": "^6.24.1",
     "babel-plugin-transform-decorators-legacy": "^1.3.5",
     "babel-plugin-transform-decorators-legacy": "^1.3.5",