paricafe/src/client/app/desktop/views/widgets/messaging.vue

56 lines
1.2 KiB
Vue
Raw Normal View History

2018-02-14 21:36:42 -06:00
<template>
<div class="mkw-messaging">
2019-02-15 00:35:52 -06:00
<ui-container :show-header="props.design == 0">
<template slot="header"><fa icon="comments"/>{{ $t('title') }}</template>
<button slot="func" @click="add"><fa icon="plus"/></button>
2018-04-19 17:45:37 -05:00
<x-messaging ref="index" compact @navigate="navigate"/>
2019-02-15 00:35:52 -06:00
</ui-container>
2018-02-14 21:36:42 -06:00
</div>
</template>
<script lang="ts">
2018-02-24 09:18:09 -06:00
import define from '../../../common/define-widget';
import i18n from '../../../i18n';
2018-02-24 09:18:09 -06:00
import MkMessagingRoomWindow from '../components/messaging-room-window.vue';
2018-04-19 22:18:50 -05:00
import MkMessagingWindow from '../components/messaging-window.vue';
2018-02-21 10:08:49 -06:00
2018-02-14 21:36:42 -06:00
export default define({
name: 'messaging',
2018-02-21 00:30:03 -06:00
props: () => ({
2018-02-14 21:36:42 -06:00
design: 0
2018-02-21 00:30:03 -06:00
})
2018-02-14 21:36:42 -06:00
}).extend({
i18n: i18n('desktop/views/widgets/messaging.vue'),
components: {
XMessaging: () => import('../../../common/views/components/messaging.vue').then(m => m.default)
},
2018-02-14 21:36:42 -06:00
methods: {
navigate(user) {
2018-11-08 17:13:34 -06:00
this.$root.new(MkMessagingRoomWindow, {
2018-02-22 08:53:07 -06:00
user: user
});
2018-02-14 21:36:42 -06:00
},
2018-04-19 22:18:50 -05:00
add() {
2018-11-08 17:13:34 -06:00
this.$root.new(MkMessagingWindow);
2018-04-19 22:18:50 -05:00
},
2018-02-14 21:36:42 -06:00
func() {
if (this.props.design == 1) {
this.props.design = 0;
} else {
this.props.design++;
}
2018-04-29 03:17:15 -05:00
this.save();
2018-02-14 21:36:42 -06:00
}
}
});
</script>
<style lang="stylus" scoped>
.mkw-messaging
2018-04-19 18:05:57 -05:00
.mk-messaging
2018-02-14 21:36:42 -06:00
max-height 250px
overflow auto
</style>