forked from m0ngr31/DailyNotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show current notes tasks only
- Loading branch information
Showing
5 changed files
with
149 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<template> | ||
<div class="field"> | ||
<b-checkbox v-model="task.completed" @input="updateTask"> | ||
{{ this.task.name }} | ||
</b-checkbox> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from "vue"; | ||
import Component from "vue-class-component"; | ||
import { Inject } from "vue-property-decorator"; | ||
import SidebarInst from "../services/sidebar"; | ||
@Component({ | ||
props: { | ||
task: { | ||
type: Object, | ||
required: true | ||
}, | ||
index: { | ||
type: Number, | ||
required: true | ||
} | ||
} | ||
}) | ||
export default class TaskItem extends Vue { | ||
public task: any; | ||
public index: any; | ||
public sidebar = SidebarInst; | ||
public completed: Boolean = false; | ||
@Inject() | ||
public global: any; | ||
public async updateTask() { | ||
this.global.taskList.splice(this.index, 1, this.task); | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
.level-item > .dropdown > .dropdown-menu { | ||
width: 300px; | ||
} | ||
.level-item > .dropdown > .dropdown-menu > .dropdown-content { | ||
max-height: 400px; | ||
overflow-y: auto; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<div class="level-item alt-button"> | ||
<b-dropdown aria-role="list"> | ||
<b-tooltip | ||
label="Tasks" | ||
position="is-bottom" | ||
slot="trigger" | ||
role="button" | ||
> | ||
<b-icon icon="tasks"></b-icon> | ||
</b-tooltip> | ||
<b-dropdown-item | ||
custom | ||
v-for="(task, idx) in global.taskList" | ||
:key="task.index" | ||
> | ||
<task-item :task="task" :index="idx"></task-item> | ||
</b-dropdown-item> | ||
<div class="no-tasks" v-if="!global.taskList.length">No tasks found</div> | ||
</b-dropdown> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Vue, Component, Inject, Watch } from "vue-property-decorator"; | ||
import _ from "lodash"; | ||
import TaskItem from "./TaskItem.vue"; | ||
@Component({ | ||
components: { TaskItem } | ||
}) | ||
export default class Tasks extends Vue { | ||
@Inject() | ||
public global: any; | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.no-tasks { | ||
margin-left: 1em; | ||
color: black; | ||
} | ||
</style> |