Commit 128f7740 authored by les's avatar les
Browse files

display a message when a new about is saved

parent 65d7b0dc
......@@ -4,12 +4,14 @@
Editor(v-if='$auth.user && $auth.user.is_admin'
v-model='about')
el-button.float-right(type='success' plain icon='el-icon-check'
@click='setSetting({key: "about", value: about})') {{$t('common.save')}}
@click='save') {{$t('common.save')}}
div(v-else v-html='about')
</template>
<script>
import Editor from '@/components/Editor'
import { mapState, mapActions } from 'vuex'
import { Message } from 'element-ui'
export default {
components: { Editor },
data ({ $store }) {
......@@ -18,7 +20,17 @@ export default {
}
},
computed: mapState(['settings']),
methods: mapActions(['setSetting']),
methods: {
...mapActions(['setSetting']),
save () {
Message({
showClose: true,
type: 'success',
message: this.$t('common.done')
})
this.setSetting({ key: 'about', value: this.about })
}
},
head () {
return {
title: `${this.settings.title} - ${this.$t('common.info')}`
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment