[Client] Resolve #2951

あと検索フォームでサジェストを有効に
This commit is contained in:
syuilo
2018-12-16 08:45:10 +09:00
parent 2faa58928f
commit b7c5c71c6f
7 changed files with 31 additions and 18 deletions

View File

@@ -21,21 +21,23 @@ class Autocomplete {
private suggestion: any;
private textarea: any;
private vm: any;
private model: any;
private currentType: string;
private opts: {
model: string;
};
private get text(): string {
return this.vm[this.model];
return this.vm[this.opts.model];
}
private set text(text: string) {
this.vm[this.model] = text;
this.vm[this.opts.model] = text;
}
/**
* 対象のテキストエリアを与えてインスタンスを初期化します。
*/
constructor(textarea, vm, model) {
constructor(textarea, vm, opts) {
//#region BIND
this.onInput = this.onInput.bind(this);
this.complete = this.complete.bind(this);
@@ -45,7 +47,7 @@ class Autocomplete {
this.suggestion = null;
this.textarea = textarea;
this.vm = vm;
this.model = model;
this.opts = opts;
}
/**