methods: {
login() {
this.$auth.login({
params: {
email: this.email,
password: this.password
},
success: () => {
// handle redirection
const redirectTo = this.$auth.redirect()
? this.$auth.redirect().from.name
: this.$auth.user().role === 2
? 'admin.dashboard'
: 'dashboard'
this.$router.push({name: redirectTo})
},
error: error => {
this.has_error = true
this.errors = error.response.data.errors || {}
this.error = error.response.data.error
},
rememberMe: this.remember_me,
fetchUser: true
})
},
........
}
const mqDesktop = window.matchMedia('(min-width: 992px)');
const mqMobile = window.matchMedia('(max-width: 991px)');
mqDesktop.addListener(e => { if (e.matches) this.setBreakpoint('desktop');});
mqMobile.addListener(e => { if (e.matches) this.setBreakpoint('mobile'); });
if (mqDesktop.matches) this.setBreakpoint('desktop');
if (mqMobile.matches) this.setBreakpoint('mobile');
this.setBreakpoint()
— это мутация вьюкса. computed:{
classes(){
return {
pagination__btn_disabled: !this.prevPage,
[`pagination__btn_theme_${this.theme}`]: !!this.theme,
}
}
}
<button
class="pagination__btn"
:class="classes"
:disabled="!prevPage"
type="button"
title="Назад"
@click="onPrevPage"
>
<img class="pagination__icon" src="/svg/admin/pagination/prev.svg" alt="Назад">
</button>
<div id="app">
<router-view></router-view>
</div>
<main class="main">
<app-aside></app-aside>
<router-view></router-view>
</main>
<section class="app__section">
<section-header></section-header>
<router-view></router-view>
</section>
data() {
return {
isShowHelloBlock: false,
}
}
<div :class="{someClass : isShowHelloBlock}">Hello</div>
<button @click="isShowHelloBlock = true">toggle block</button>
2-й блок как будто не видит ширины основного блока, которую задает 1-й блок (sometext)
.inp {
flex: 1 1 auto;
width: 0;
}
@font-face {
font-family: 'Geometria';
src: local('Geometria Thin'), local('Geometria-Thin'),
url('~@/assets/fonts/geometria/Geometria-Thin.woff2') format('woff2'),
url('~@/assets/fonts/geometria/Geometria-Thin.woff') format('woff');
font-weight: 100;
font-style: normal;
}