Skip to content

Commit

Permalink
element ui partial import
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottzheng committed Sep 9, 2019
1 parent 90d2448 commit b7b1019
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
11 changes: 10 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
module.exports = {
presets: ["@vue/app"]
presets: ["@vue/app"],
plugins: [
[
"component",
{
libraryName: "element-ui",
styleLibraryName: "~theme"
}
]
]
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@vue/eslint-config-prettier": "^4.0.1",
"@vue/eslint-config-typescript": "^3.2.0",
"babel-eslint": "^10.0.1",
"babel-plugin-component": "^1.1.1",
"electron": "^3.0.0",
"element-theme-chalk": "^2.11.1",
"eslint": "^5.8.0",
Expand Down Expand Up @@ -87,7 +88,6 @@
"darwin"
],
"arches": [
"ia32",
"x64"
]
},
Expand Down
Binary file modified src/images/caiyun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/youdao.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 24 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,37 @@ import router from "./router";
import store from "./store";
import { ipcRenderer } from "electron";
import { MessageType } from "./tools/enums";
import ElementUI from "element-ui";

import {
Button,
Select,
Switch,
Tooltip,
Row,
Col,
Tabs,
TabPane,
Option,
Input
} from "element-ui";

import "../theme/index.css";
import App from "./App.vue";
import { constants, version } from "./core/constant";

const remote = require("electron").remote;
const controller = remote.getGlobal("controller");

Vue.use(ElementUI);
Vue.use(Button);
Vue.use(Select);
Vue.use(Tooltip);
Vue.use(Switch);
Vue.use(Col);
Vue.use(Row);
Vue.use(Tabs);
Vue.use(TabPane);
Vue.use(Option);
Vue.use(Input);

Vue.prototype.$t = controller.getT();
Vue.prototype.$log = remote.getGlobal("log");
Expand Down

0 comments on commit b7b1019

Please sign in to comment.