mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-22 06:49:35 +00:00
[napajanie modalov na BE]
This commit is contained in:
1 parent
26792a85a6
commit
4c8ee66cd6
34 files changed
+494
-396
No files matched your search
@@ -14,22 +14,22 @@ const app = createApp(App)
|
||||
# Examples
|
||||
1. Listen for event
|
||||
```javascript
|
||||
this.eventBus.on('eventname', (optionalData) => ...do something)
|
||||
this.$events.on('eventname', (optionalData) => ...do something)
|
||||
```
|
||||
|
||||
2. Listen for all events
|
||||
```javascript
|
||||
this.eventBus.on('*', (optionalData) => ...do something)
|
||||
this.$events.on('*', (optionalData) => ...do something)
|
||||
```
|
||||
|
||||
3. Fire event
|
||||
```javascript
|
||||
this.eventBus.emit('eventname', optionalData)
|
||||
this.$events.emit('eventname', optionalData)
|
||||
```
|
||||
|
||||
4. Clear all event listeners
|
||||
```javascript
|
||||
this.eventBus.all.clear()
|
||||
this.$events.all.clear()
|
||||
```
|
||||
|
||||
5. More on https://www.npmjs.com/package/mitt
|
||||
@@ -5,7 +5,7 @@ export default {
|
||||
install: (app, options: Options) => {
|
||||
if (options && options.disabled === true) return
|
||||
|
||||
const eventBus = mitt()
|
||||
app.config.globalProperties.eventBus = eventBus
|
||||
const events = mitt()
|
||||
app.config.globalProperties.$events = events
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ export default {
|
||||
methods: {
|
||||
languageSelected(language) {
|
||||
this.$w18n.changeLanguage(language)
|
||||
// this.eventBus.emit("language-changed", language)
|
||||
// this.$events.emit("language-changed", language)
|
||||
popoverController.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
if (!options || !options.languages || !options.defaultLanguage)
|
||||
return console.warn('[@wezeo/i18n] Could not initialize i18n. Missing configuration options.')
|
||||
|
||||
if (!app.config.globalProperties.eventBus) {
|
||||
if (!app.config.globalProperties.$events) {
|
||||
app.use(events)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user