Answer the question
In order to leave comments, you need to log in
How to properly use an interface in Vuejs?
How to display name, description , time data?
i have interface task.interface.ts
export interface TaskInterface{
name: string
description1: string
time: string
}
<template lang="pug">
.task()
.name
| {{task.name}}
.description
| {{task.description}}
.time
| {{task.time}}
</template>
import { TaskInterface } from '@/types/task.interface'
data () {
return {
task: {}
},
methods: {
setTask (task: TaskInterface) {
task.name = '123'
task.description1 = '123'
task.time = '123'
this.task = task
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question