You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 24, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,27 @@ Gets triggered when the autocomplete input got changed
126
126
#### keypress
127
127
Gets triggered when a key gets pressed
128
128
129
+
### Exposed component functions
130
+
131
+
These functions are accessible by setting "ref" on the component ([Refs documentation](https://vuejs.org/v2/guide/components.html#Child-Component-Refs)). See example below how to use these functions.
132
+
133
+
#### clear()
134
+
135
+
Call to clear the value of the user input.
136
+
137
+
#### focus()
138
+
139
+
Call focus to focus on the element
140
+
141
+
#### blur()
142
+
143
+
Call blur to blur (unfocus) the element
144
+
145
+
#### update(value)
146
+
147
+
Call to update the user input with a new value
148
+
149
+
129
150
### Example
130
151
131
152
Please note that you need to provide what method will listen (`v-on:placechanged`) to an event when the address data is obtained.
@@ -136,6 +157,7 @@ Please note that you need to provide what method will listen (`v-on:placechanged
136
157
<h2>Your Address</h2>
137
158
138
159
<vue-google-autocomplete
160
+
ref="address"
139
161
id="map"
140
162
classname="form-control"
141
163
placeholder="Please type your address"
@@ -158,6 +180,12 @@ Please note that you need to provide what method will listen (`v-on:placechanged
158
180
}
159
181
},
160
182
183
+
mounted() {
184
+
// To demonstrate functionality of exposed component functions
0 commit comments