first commit
This commit is contained in:
27
resources/js/store/modules/title.js
vendored
Normal file
27
resources/js/store/modules/title.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
const state = {
|
||||
title: 'Welcome'
|
||||
}
|
||||
|
||||
const getter = {
|
||||
pageTitle: state => {
|
||||
return state.title
|
||||
}
|
||||
}
|
||||
|
||||
const actions = {
|
||||
setPageTitle({commit, state}, title) {
|
||||
commit('setTitle', title)
|
||||
|
||||
document.title = state.title
|
||||
}
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
setTitle(state, title) {
|
||||
state.title = title + ' | Facebook'
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
state, getter, actions, mutations,
|
||||
}
|
||||
Reference in New Issue
Block a user