Skip to content

Commit 3ce6005

Browse files
authored
Merge pull request #117 from kahirokunn/patch-1
refactor index.js
2 parents 2905c01 + d60f786 commit 3ce6005

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/index.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ import {Toasted as T} from './js/toast';
22
import ToastComponent from './toast.vue';
33

44
const Toasted = {
5-
install: (Vue, options) => {
5+
install(Vue, options) {
6+
if (!options) {
7+
options = {};
8+
}
69

7-
if(!options) {
8-
options = {};
9-
}
10-
11-
let Toast = new T(options)
12-
Vue.component('toasted', ToastComponent);
13-
Vue.toasted = Vue.prototype.$toasted = Toast;
10+
const Toast = new T(options);
11+
Vue.component('toasted', ToastComponent);
12+
Vue.toasted = Vue.prototype.$toasted = Toast;
1413
}
1514
};
1615

@@ -19,4 +18,4 @@ if (typeof window !== 'undefined' && window.Vue) {
1918
window.Toasted = Toasted;
2019
}
2120

22-
export default Toasted
21+
export default Toasted

0 commit comments

Comments
 (0)