タスク一覧コンポーネント wip

This commit is contained in:
ろむねこ 2024-07-18 15:14:48 +09:00
parent d243a8c92c
commit f314467f89
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168

View File

@ -0,0 +1,42 @@
<template>
<q-list bordered>
<q-item v-for="task in tasks" :key="task.id" class="q-py-sm q-px-md">
<q-item-section>
<q-item-label>{{ task.name }}</q-item-label>
<q-item-label caption>{{ task.price }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-btn @click="completeTask(task)" label="完了" color="primary" rounded/>
</q-item-section>
</q-item>
</q-list>
</template>
<script setup>
import { ref } from 'vue';
const tasks = ref([
{ id: 1, name: '風呂掃除', price: 100 },
{ id: 2, name: '玄関掃除', price: 100 },
{ id: 3, name: 'ゴミ出し', price: 100 },
//
]);
const completeTask = (task) => {
//
console.log(`${task.name}が完了しました`);
};
</script>
<style scoped>
.q-btn {
background-color: #3b5998;
color: #fff;
}
.q-item-section {
align-items: center;
}
.q-list {
background: #f5f5f5;
}
</style>