New vuejs Button component

This commit is contained in:
Bubka 2020-01-15 17:43:28 +01:00
parent aef68df370
commit 38288332c5
2 changed files with 43 additions and 0 deletions

2
resources/js/app.js vendored
View File

@ -15,6 +15,7 @@ import Edit from './views/Edit'
import PasswordRequest from './views/auth/password/Request'
import PasswordReset from './views/auth/password/Reset'
import NotFound from './views/Error'
import Button from './components/Button'
import { library } from '@fortawesome/fontawesome-svg-core'
@ -24,6 +25,7 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
library.add(faPlus, faQrcode, faImage, faTrash, faEdit, faCheck, faLock, faLockOpen, faSearch);
Vue.component('font-awesome-icon', FontAwesomeIcon)
Vue.component('VButton', Button)
// const lang = document.documentElement.lang.substr(0, 2);
const lang = 'en';

View File

@ -0,0 +1,41 @@
<template>
<button
:type="nativeType"
:class="{
[`${color}`]: true,
'is-large': isLarge,
'is-focused': isFocused,
}"
class="button">
<slot />
</button>
</template>
<script>
export default {
name: 'VButton',
props: {
color: {
type: String,
default: 'is-link'
},
nativeType: {
type: String,
default: 'submit'
},
isFocused: {
type: Boolean,
default: false
},
isLarge: {
type: Boolean,
default: false
}
}
}
</script>