forked from potsda.mn/mobilizon
Improve Typescript support for ActorAutoComplete component
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
5c11bef368
commit
56d33214f1
|
@ -59,29 +59,29 @@ export default class ActorAutoComplete extends Vue {
|
|||
|
||||
totalPages = 1;
|
||||
|
||||
mounted() {
|
||||
mounted(): void {
|
||||
this.selected = this.defaultSelected;
|
||||
}
|
||||
|
||||
data() {
|
||||
data(): Record<string, unknown> {
|
||||
return {
|
||||
getAsyncData: debounce(this.doGetAsyncData, 500),
|
||||
};
|
||||
}
|
||||
|
||||
@Watch("defaultSelected")
|
||||
updateDefaultSelected(defaultSelected: IPerson) {
|
||||
updateDefaultSelected(defaultSelected: IPerson): void {
|
||||
console.log("update defaultSelected", defaultSelected);
|
||||
this.selected = defaultSelected;
|
||||
this.name = defaultSelected.preferredUsername;
|
||||
}
|
||||
|
||||
handleSelect(selected: IPerson) {
|
||||
handleSelect(selected: IPerson): void {
|
||||
this.selected = selected;
|
||||
this.$emit("change", selected);
|
||||
}
|
||||
|
||||
async doGetAsyncData(name: string) {
|
||||
async doGetAsyncData(name: string): Promise<void> {
|
||||
this.baseData = [];
|
||||
if (this.name !== name) {
|
||||
this.name = name;
|
||||
|
|
Loading…
Reference in a new issue