Кто-нибудь объяснит синтаксис задания типа свойствам данных vue.js (приложение пишется на typescript)?
Мне нужно примерно следующее:
@Component({
data() {
return {
groups: Array<GroupInfo> = []
}
}
})
Но vue воспринимает тип как значение, и я запутался, как правильно поступить.
Переведено с английского·Показать оригиналCan somebody explain the syntax for assigning a type to vue.js data properties (the application uses typescript)?
What I'm after looks something like this:
@Component({
data() {
return {
groups: Array<GroupInfo> = []
}
}
})
However, vue treats the type like a value, leaving me confussed about the right approach.