Sharkey/src/client/app/mobile/views/pages/user-list.vue

73 lines
1.2 KiB
Vue
Raw Normal View History

2018-05-29 22:45:27 +03:00
<template>
<mk-ui>
<span slot="header" v-if="!fetching"><fa icon="list"/>{{ list.title }}</span>
2018-05-29 22:45:27 +03:00
<main v-if="!fetching">
<ul>
<li v-for="user in users" :key="user.id"><router-link :to="user | userPage">
<misskey-flavored-markdown :text="user.name || user.username" :shouldBreak="false" :plainText="true" :custom-emojis="user.emojis"/>
</router-link></li>
2018-05-29 22:45:27 +03:00
</ul>
</main>
</mk-ui>
</template>
<script lang="ts">
import Vue from 'vue';
import Progress from '../../../common/scripts/loading';
export default Vue.extend({
data() {
return {
fetching: true,
2018-05-30 12:13:20 +03:00
list: null,
users: null
2018-05-29 22:45:27 +03:00
};
},
watch: {
$route: 'fetch'
},
created() {
this.fetch();
},
methods: {
fetch() {
Progress.start();
this.fetching = true;
2018-11-09 01:13:34 +02:00
this.$root.api('users/lists/show', {
2018-05-29 22:45:27 +03:00
listId: this.$route.params.list
}).then(list => {
this.list = list;
this.fetching = false;
Progress.done();
2018-05-30 12:13:20 +03:00
2018-11-09 01:13:34 +02:00
this.$root.api('users/show', {
2018-05-30 12:13:20 +03:00
userIds: this.list.userIds
}).then(users => {
this.users = users;
});
2018-05-29 22:45:27 +03:00
});
}
}
});
</script>
<style lang="stylus" scoped>
2018-09-26 14:19:35 +03:00
2018-05-29 22:45:27 +03:00
main
width 100%
max-width 680px
margin 0 auto
padding 8px
@media (min-width 500px)
padding 16px
@media (min-width 600px)
padding 32px
</style>