mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-01-22 22:30:05 +01:00
Declare js vars from Blade template at Vue prototype level to ease access in vue components
This commit is contained in:
parent
ab5948ee1d
commit
f7a69d8197
3
resources/js/app.js
vendored
3
resources/js/app.js
vendored
@ -8,6 +8,9 @@ import App from './components/App'
|
||||
|
||||
import './components'
|
||||
|
||||
Vue.prototype.$appSettings = appSettings
|
||||
Vue.prototype.$appVersion = appVersion
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
components: { App },
|
||||
|
@ -2,7 +2,7 @@
|
||||
<form-wrapper :fail="fail" :success="success">
|
||||
<div class="tags has-addons">
|
||||
<span class="tag is-dark">2FAuth</span>
|
||||
<span class="tag is-info">v{{ version }}</span>
|
||||
<span class="tag is-info">v{{ $appVersion }}</span>
|
||||
</div>
|
||||
<form @submit.prevent="handleSubmit" @change="handleSubmit" @keydown="form.onKeydown($event)">
|
||||
<form-select :options="options" :form="form" fieldName="lang" :label="$t('settings.forms.language.label')" :help="$t('settings.forms.language.help')" />
|
||||
@ -22,13 +22,12 @@
|
||||
fail: '',
|
||||
form: new Form({
|
||||
lang: this.$root.$i18n.locale,
|
||||
showTokenAsDot: appSettings.showTokenAsDot,
|
||||
showTokenAsDot: this.$appSettings.showTokenAsDot,
|
||||
}),
|
||||
options: [
|
||||
{ text: this.$t('languages.en'), value: 'en' },
|
||||
{ text: this.$t('languages.fr'), value: 'fr' },
|
||||
],
|
||||
version: appVersion
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@ -48,7 +47,7 @@
|
||||
this.$router.go()
|
||||
}
|
||||
else {
|
||||
appSettings = response.data.settings
|
||||
this.$appSettings = response.data.settings
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
|
Loading…
Reference in New Issue
Block a user