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

64 lines
996 B
Vue
Raw Normal View History

2018-05-29 19:45:27 +00:00
<template>
<mk-ui>
<span slot="header" v-if="!fetching"><fa icon="list"/>{{ list.title }}</span>
2018-05-29 19:45:27 +00:00
<main v-if="!fetching">
<x-editor :list="list"/>
2018-05-29 19:45:27 +00:00
</main>
</mk-ui>
</template>
<script lang="ts">
import Vue from 'vue';
import Progress from '../../../common/scripts/loading';
import XEditor from '../../../common/views/components/user-list-editor.vue';
2018-05-29 19:45:27 +00:00
export default Vue.extend({
components: {
XEditor
},
2018-05-29 19:45:27 +00:00
data() {
return {
fetching: true,
list: null
2018-05-29 19:45:27 +00:00
};
},
watch: {
$route: 'fetch'
},
created() {
this.fetch();
},
methods: {
fetch() {
Progress.start();
this.fetching = true;
2018-11-08 23:13:34 +00:00
this.$root.api('users/lists/show', {
2018-05-29 19:45:27 +00:00
listId: this.$route.params.list
}).then(list => {
this.list = list;
this.fetching = false;
Progress.done();
});
}
}
});
</script>
<style lang="stylus" scoped>
main
width 100%
max-width 680px
margin 0 auto
padding 8px
@media (min-width 500px)
padding 16px
@media (min-width 600px)
padding 32px
</style>