You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 17, 2022. It is now read-only.
[](https://github.com/mazipan/vue2-simplert-plugin)[](https://www.npmjs.com/package/vue2-simplert-plugin)[](https://www.npmjs.com/package/vue2-simplert-plugin)[](https://github.com/mazipan/vue2-simplert-plugin/actions/workflows/build_deploy.yml)
8
6
9
7
## Why we need ?
10
8
11
9
When we using [vue2-simplert](https://github.com/mazipan/vue2-simplert), we will need to `import` the library in every place we need. This is very bored because we do same task in many place. In [vue2-simplert](https://github.com/mazipan/vue2-simplert) we need to access method inside using `$refs` which is not recommended. For solving those problems I reborn [vue2-simplert](https://github.com/mazipan/vue2-simplert) as Vue.js Plugins and using EventBus for open/close.
+ Remove all import [vue2-simplert](https://github.com/mazipan/vue2-simplert) in your components and/or pages, because as Plugin you dont need to import in all components
105
+
102
106
```javascript
103
107
importSimplertfrom'vue2-simplert'
104
108
```
109
+
105
110
+ Remove all adding component [vue2-simplert](https://github.com/mazipan/vue2-simplert) in your components and/or pages, because you dont need set components again
111
+
106
112
```javascript
107
113
components: {Simplert}
108
114
```
115
+
109
116
+ Remove all template html snippet in each components
117
+
110
118
```html
111
119
<simplert:useRadius="true"
112
120
:useIcon="true"
113
121
ref="simplert">
114
122
</simplert>
115
123
```
124
+
116
125
+ Add new html snippet in root application, ex : `App.vue`
126
+
117
127
```html
118
128
<simplert>
119
129
</simplert>
120
130
```
131
+
121
132
+ Change all call method open with new plugin method, you dont need to change all configuration
133
+
122
134
```javascript
123
135
// change this call
124
136
this.$refs.simplert.openSimplert(obj)
125
137
// to this way
126
138
this.$Simplert.open(obj)
127
139
```
140
+
128
141
+ And **DONE**:+1: !!!
129
142
130
143
## Documentation Vue2-Simplert
@@ -146,4 +159,4 @@ If you'd like to contribute, head to the [contributing guidelines](CONTRIBUTING.
0 commit comments