evui 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evui",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -1,3 +1,7 @@
1
- import MessageBox from './message-box';
1
+ import MessageBox from './message-box.vue';
2
+ import MessageBoxFn from './message-box';
2
3
 
3
- export default MessageBox;
4
+ export {
5
+ MessageBox,
6
+ MessageBoxFn,
7
+ };
@@ -1,13 +1,8 @@
1
1
  import Vue from 'vue';
2
2
  import MessageBoxVue from './message-box.vue';
3
3
 
4
- const MsgVue = Vue.extend(MessageBoxVue);
5
-
6
- const root = document.createElement('div');
7
- root.classList.add('ev-message-box-root');
8
- document.body.appendChild(root);
9
-
10
4
  let instance;
5
+
11
6
  export default function messageBox(options = {}) {
12
7
  const dataOptions = Object.assign(
13
8
  {
@@ -20,12 +15,18 @@ export default function messageBox(options = {}) {
20
15
  );
21
16
 
22
17
  if (!instance) {
18
+ const MsgVue = Vue.extend(MessageBoxVue);
23
19
  instance = new MsgVue({
24
20
  data: dataOptions,
25
21
  });
26
22
  instance.$mount();
23
+
24
+ const root = document.createElement('div');
25
+ root.classList.add('ev-message-box-root');
26
+ document.body.appendChild(root);
27
27
  root.appendChild(instance.$el);
28
28
  }
29
+
29
30
  Object.assign(instance._data, dataOptions);
30
31
  instance.visible = true;
31
32
  }
@@ -73,15 +73,7 @@
73
73
  </template>
74
74
 
75
75
  <script type="text/babel">
76
- import EvButton from '@/components/button/button';
77
- import EvIcon from '@/components/icon/icon';
78
-
79
76
  export default {
80
- name: 'EvMessageBox',
81
- components: {
82
- EvButton,
83
- EvIcon,
84
- },
85
77
  data() {
86
78
  return {
87
79
  type: 'info',
package/src/index.js CHANGED
@@ -27,7 +27,10 @@ import EvMarkdown from './components/markdown';
27
27
  import EvGrid from './components/grid/grid';
28
28
  import EvMessage from './components/message/index';
29
29
  import EvNotification from './components/notification/index';
30
- import EvMessageBox from './components/message-box/index';
30
+ import {
31
+ MessageBox as EvMessageBox,
32
+ MessageBoxFn,
33
+ } from './components/message-box/index';
31
34
 
32
35
  const components = {
33
36
  EvButton,
@@ -76,7 +79,7 @@ const install = function (Vue) {
76
79
  });
77
80
 
78
81
  Vue.prototype.$message = EvMessage;
79
- Vue.prototype.$messagebox = EvMessageBox;
82
+ Vue.prototype.$messagebox = MessageBoxFn;
80
83
  Vue.prototype.$notify = EvNotification;
81
84
  };
82
85