Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Проблемы #1

Open
mrTimofey opened this issue May 7, 2020 · 3 comments
Open

Проблемы #1

mrTimofey opened this issue May 7, 2020 · 3 comments

Comments

@mrTimofey
Copy link

No description provided.

@mrTimofey
Copy link
Author

gMapsScript.setAttribute('src', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBTKfXV6gO49IDRHLiGulLXFjPtsMeamDo');

key лучше не хардкодить, а вынести в конструктор класса

@mrTimofey
Copy link
Author

this.driver.create(this.$refs.map as HTMLElement, this.center);

Ты можешь указать сразу тип для $refs, чтобы так не писать. Что-то типа этого:

class Component {
  $refs!: { map: HTMLElement }
}

@mrTimofey
Copy link
Author

yaMaps: IMapDriver = new YMapsDriver();

Лучше такие объекты как-то по-другому инициализировать - через provide/inject или в created их добавлять. Иначе Vue их обрабатывает как реактивные объекты, так как они в data попадают

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant