Add jsdoc for Tag type

Does not work properly but is still useful
This commit is contained in:
Mathias Haugsbø 2022-12-27 23:27:23 +01:00
parent 608e3f5582
commit 4d0bdae6bf
2 changed files with 27 additions and 3 deletions

View File

@ -18,9 +18,15 @@
</template>
<script>
/**
* @typedef {import('./TagsManager.vue').Tag} Tag
*/
export default {
props: {
/** Object representing tag */
/** Object representing tag
* @type {Tag}
*/
item: {
type: Object,
required: true,
@ -32,7 +38,7 @@ export default {
},
/**
* Size of tag
* @values normal, small
* @type {"normal" | "small"}
*/
size: {
type: String,

View File

@ -133,13 +133,27 @@ import { useToast } from "vue-toastification";
import Tag from "../components/Tag.vue";
const toast = useToast();
/**
* @typedef Tag
* @type {object}
* @property {number | undefined} id
* @property {number | undefined} monitor_id
* @property {number | undefined} tag_id
* @property {string} value
* @property {string} name
* @property {string} color
* @property {boolean | undefined} new
*/
export default {
components: {
Tag,
VueMultiselect,
},
props: {
/** Array of tags to be pre-selected */
/** Array of tags to be pre-selected
* @type {Tag[]}
*/
preSelectedTags: {
type: Array,
default: () => [],
@ -147,10 +161,14 @@ export default {
},
data() {
return {
/** @type {Modal | null} */
modal: null,
/** @type {Tag[]} */
existingTags: [],
processing: false,
/** @type {Tag[]} */
newTags: [],
/** @type {Tag[]} */
deleteTags: [],
newDraftTag: {
name: null,