yumechi-no-kuni/src/client/app/dev/views/apps.vue

40 lines
863 B
Vue
Raw Normal View History

2018-02-27 09:11:28 -06:00
<template>
2018-02-27 14:43:14 -06:00
<mk-ui>
<b-card :header="$t('header')">
<b-button to="/app/new" variant="primary">{{ $t('create-app') }}</b-button>
2018-02-27 14:43:14 -06:00
<hr>
<div class="apps">
<p v-if="fetching">{{ $t('@.loading') }}</p>
2018-02-27 14:43:14 -06:00
<template v-if="!fetching">
<b-alert v-if="apps.length == 0">{{ $t('app-missing') }}</b-alert>
2018-02-27 14:43:14 -06:00
<b-list-group v-else>
<b-list-group-item v-for="app in apps" :key="app.id" :to="`/app/${app.id}`">
{{ app.name }}
</b-list-group-item>
</b-list-group>
</template>
</div>
</b-card>
</mk-ui>
2018-02-27 09:11:28 -06:00
</template>
<script lang="ts">
import Vue from 'vue';
import i18n from '../../i18n';
2018-02-27 09:30:36 -06:00
export default Vue.extend({
i18n: i18n('dev/views/apps.vue'),
2018-02-27 09:30:36 -06:00
data() {
return {
fetching: true,
apps: []
};
},
mounted() {
2018-11-08 17:13:34 -06:00
this.$root.api('my/apps').then(apps => {
2018-02-27 09:30:36 -06:00
this.apps = apps;
this.fetching = false;
});
}
});
2018-02-27 09:11:28 -06:00
</script>