c3lf-system-3/src/App.vue

53 lines
1.5 KiB
Vue
Raw Normal View History

2019-11-13 21:02:44 +00:00
<template>
2019-11-13 22:21:19 +00:00
<div id="app">
2019-11-14 02:59:17 +00:00
<Navbar/>
2019-11-15 19:00:40 +00:00
<div class="container-fluid px-xl-5 mt-3">
<div class="row" v-if="layout === 'table'">
<div class="col-xl-8 offset-xl-2">
<Table
:columns="['uid', 'description', 'box', 'image']"
:items="loadedItems"
:keyName="'uid'"
/>
</div>
</div>
<Cards
v-if="layout === 'cards'"
2019-11-14 18:30:00 +00:00
:columns="['uid', 'description', 'box', 'image']"
:items="loadedItems"
:keyName="'uid'"
2019-11-16 00:48:15 +00:00
v-slot="{ item }"
>
<img
:src="`https://picsum.photos/id/${item.uid + 50}/200/200`"
alt="item"
class="card-img-top img-fluid"
>
<div class="card-body">
<h6 class="card-title">{{ item.description }}</h6>
<h6 class="card-subtitle text-secondary">uid: {{ item.uid }} box: {{ item.box }}</h6>
</div>
</Cards>
2019-11-14 01:22:20 +00:00
</div>
2019-11-13 22:21:19 +00:00
</div>
2019-11-13 21:02:44 +00:00
</template>
<script>
2019-11-14 03:37:35 +00:00
import Table from '@/components/Table';
2019-11-14 02:59:17 +00:00
import Navbar from '@/components/Navbar';
2019-11-15 19:00:40 +00:00
import Cards from '@/components/Cards';
2019-11-14 18:30:00 +00:00
import { mapState } from 'vuex';
2019-11-14 03:37:35 +00:00
2019-11-13 21:02:44 +00:00
export default {
2019-11-14 01:22:20 +00:00
name: 'app',
2019-11-15 19:00:40 +00:00
components: { Navbar, Table, Cards },
computed: mapState(['loadedItems', 'layout'])
2019-11-13 21:21:47 +00:00
};
2019-11-13 21:02:44 +00:00
</script>
<style>
2019-11-14 01:22:20 +00:00
body, html, #app {
2019-11-14 18:30:00 +00:00
background: #000;
2019-11-14 01:22:20 +00:00
}
2019-11-13 21:02:44 +00:00
</style>