6 changed files with 181 additions and 181 deletions
@ -1,37 +0,0 @@ |
|||||||
import { Component, OnInit, Inject } from '@angular/core'; |
|
||||||
import { AutocompleteSelect } from '../map'; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'keDa-Search', |
|
||||||
templateUrl: './keDaSearch.html', |
|
||||||
styleUrls: ['./keDaSearch.scss'] |
|
||||||
}) |
|
||||||
export class KedaSearchComponent { |
|
||||||
|
|
||||||
constructor() { } |
|
||||||
static instance: KedaSearchComponent |
|
||||||
public searchList:AutocompleteSelect[] = []; //list
|
|
||||||
public leftCss:string = '0px'; |
|
||||||
public topCss:string = '0px'; |
|
||||||
public minWidthCss:string = '0px'; |
|
||||||
|
|
||||||
ngOnInit(): void { |
|
||||||
KedaSearchComponent.instance = this |
|
||||||
} |
|
||||||
|
|
||||||
// input 添加监听事件
|
|
||||||
addDOMEvent (id:string) { |
|
||||||
let input = document.getElementById(id) |
|
||||||
let DOM = input.getBoundingClientRect() |
|
||||||
// this.left = DOM.left
|
|
||||||
// this.top = DOM.top + DOM.height + 2
|
|
||||||
// this.minWidth = DOM.width
|
|
||||||
} |
|
||||||
|
|
||||||
select(e) { |
|
||||||
console.log(e) |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,39 @@ |
|||||||
|
import { Component, OnInit, Inject } from '@angular/core'; |
||||||
|
import { AutocompleteSelect } from '../../map'; |
||||||
|
|
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'SearchDownList', |
||||||
|
templateUrl: './SearchDownList.html', |
||||||
|
styleUrls: ['./SearchDownList.scss'] |
||||||
|
}) |
||||||
|
export class SearchDownList implements OnInit { |
||||||
|
private $input; |
||||||
|
constructor(inputListenId: string) { |
||||||
|
this.$input = document.getElementById(inputListenId); |
||||||
|
} |
||||||
|
public searchList: AutocompleteSelect[] = []; //list
|
||||||
|
public leftCss: string = '0px'; |
||||||
|
public topCss: string = '0px'; |
||||||
|
public minWidthCss: string = '0px'; |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
} |
||||||
|
|
||||||
|
// input 添加监听事件
|
||||||
|
addDOMEvent() { |
||||||
|
let input = document.getElementById(id) |
||||||
|
let DOM = input.getBoundingClientRect() |
||||||
|
// this.left = DOM.left
|
||||||
|
// this.top = DOM.top + DOM.height + 2
|
||||||
|
// this.minWidth = DOM.width
|
||||||
|
} |
||||||
|
|
||||||
|
select(e) { |
||||||
|
console.log(e) |
||||||
|
} |
||||||
|
|
||||||
|
watch() { |
||||||
|
//TODO:修改leftCss ,topCss
|
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue