2018-05-29 14:45:27 -05:00
|
|
|
<template>
|
|
|
|
<mk-ui>
|
2018-11-05 10:40:11 -06:00
|
|
|
<span slot="header"><fa icon="list"/>%i18n:@title%</span>
|
|
|
|
<template slot="func"><button @click="fn"><fa icon="plus"/></button></template>
|
2018-05-29 14:45:27 -05:00
|
|
|
|
|
|
|
<main>
|
|
|
|
<ul>
|
|
|
|
<li v-for="list in lists" :key="list.id"><router-link :to="`/i/lists/${list.id}`">{{ list.title }}</router-link></li>
|
|
|
|
</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,
|
|
|
|
lists: []
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
2018-08-06 23:25:50 -05:00
|
|
|
document.title = '%i18n:@title%';
|
2018-05-29 14:45:27 -05:00
|
|
|
|
|
|
|
Progress.start();
|
|
|
|
|
|
|
|
(this as any).api('users/lists/list').then(lists => {
|
|
|
|
this.fetching = false;
|
|
|
|
this.lists = lists;
|
|
|
|
|
|
|
|
Progress.done();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
fn() {
|
|
|
|
(this as any).apis.input({
|
|
|
|
title: '%i18n:@enter-list-name%',
|
|
|
|
}).then(async title => {
|
|
|
|
const list = await (this as any).api('users/lists/create', {
|
|
|
|
title
|
|
|
|
});
|
|
|
|
|
2018-09-01 09:12:51 -05:00
|
|
|
this.$router.push(`/i/lists/${list.id}`);
|
2018-05-29 14:45:27 -05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2018-09-26 06:19:35 -05:00
|
|
|
|
2018-05-29 14:45:27 -05: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>
|