
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
dgtek-google-autocomplete
Advanced tools
yarn add dgtek-google-autocomplete && rm -r node_modules/dgtek-google-autocomplete/dist/node_modules
for vue-cli:
"scripts": {
...
"serve": "yarn add dgtek-google-autocomplete && rm -r node_modules/dgtek-google-autocomplete/node_modules && vue-cli-service serve",
"build": "yarn add dgtek-google-autocomplete && rm -r node_modules/dgtek-google-autocomplete/node_modules && vue-cli-service build",
...
}
import 'dgtek-google-autocomplete/dist/dgtek-google-autocomplete.css'
/* ... other imports here */
const { DgtekGoogleAutocomplete } = require('dgtek-google-autocomplete').default
window.dispatchEvent(new CustomEvent('set-api-host', {
detail: {
host: 'https://example.com' /* API host url must be here */
}
}))
You should wait for Google maps script has been loaded in your component
data: () => ({
mapIsReady: false,
/* ... other variables here */
})
You can change the name of this method (catchEvent
) to your own
methods: {
/* your own methods here */,
catchEvent () {
const { address, addressComponents, status, url, coordinates, buildingId, error } = event.detail
... /* your code will be here */
}
}
During checking the address, a number of requests will be made to remote server.
Every request can fail.
error
field value should be null
otherwise this field contains error message
mounted () {
function waitForGoogleMapsScript () {
if (!window.google) window.requestAnimationFrame(waitForGoogleMapsScript.bind(this))
else this.mapIsReady = true
}
window.requestAnimationFrame(waitForGoogleMapsScript.bind(this))
window.addEventListener('new-address-data', this.catchEvent)
}
beforeDestroy () {
...
window.removeEventListener('new-address-data', this.catchEvent)
}
And then insert this package to your component template:
<DgtekGoogleAutocomplete v-if="mapIsReady" />
FAQs
###### Vue, Vuetify
We found that dgtek-google-autocomplete demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.