คุณสามารถใช้ attribute ต่างๆของ
<input type="text">
กับ component ได้โดยตรง<addressinput-district>
ประเถท: number
ค่าเริ่มต้น: 200
ความสูงสูงสุดของ autocomplete
ประเถท: number
ค่าเริ่มต้น: 5
จำนวนรายการที่จะให้แสดงใน autocomplete
ประเถท: string
ค่าเริ่มต้น: "อำเภอ/เขต"
label ของช่องกรอกที่อยู่
event ที่จะถูกเรียกเมื่อมีการเลือกที่อยู่ใน autocomplete
event นี้จะส่ง parameter กลับมา 1 ตัว ซึ่งก็คือ object ของที่อยู่ที่ถูกเลือก
export default { methods: { onItemSelected({ subdistrict, district, province, zipcode }) { subdistrict; // ตำบล/แขวง district; // อำเภอ/เขต province; // จังหวัด zipcode; // รหัสไปรษณีย์ } } };