export default {
data(){
return {
blockBtn: false
}
},
methods: {
async isWait(url) {
this.blockBtn = true;
let dosomething = await fetch(url)
this.blockBtn = false;
}
}
}
export default {
data(){
return {
blockBtn: false
}
},
methods: {
isWait(url) {
this.blockBtn = true;
let dosomething = fetch(url).then(() => {
this.blockBtn = false;
});
}
}
}
const state = {
status: null,
profile: {},
token: null,
const actions = {
fetchProfile: ({commit}, id, data) => {
axios.patch('/profile/user/' + id + '/', data)
.then(response => {
commit('PROFILE_SET', response.profile);
})
.catch(error => {
console.log(error, 'something went wrong')
})
},
const mutations = {
PROFILE_SET: (state, profile) => {
state.profile = profile
},
}
{ isDataReady() { return this.$store.state.isReady ;}
import Raven from 'raven-js';
import RavenVue from 'raven-js/plugins/vue';
if (ENV_PRODUCTION) {
Raven
.config(SENTRY_KEY, {
environment: ENV,
})
.addPlugin(RavenVue, Vue)
.install();
}
export default new Router({
routes: [
{
path: '/',
name: 'homepage',
component: () => import('./Home.vue').then(m => m.default),
},
]
});
Note: when mutating (rather than replacing) an Object or an Array, the old value will be the same as new value because they reference the same Object/Array. Vue doesn’t keep a copy of the pre-mutate value.
<transition
v-on:before-enter="beforeEnter"
v-on:enter="enter"
v-on:after-enter="afterEnter"
v-on:enter-cancelled="enterCancelled"
v-on:before-leave="beforeLeave"
v-on:leave="leave"
v-on:after-leave="afterLeave"
v-on:leave-cancelled="leaveCancelled"
>
<!-- ... -->
</transition>