spz-area
A linkage component for country, province, and phone code. The province and phone code selections will get the corresponding country's province and phone code data when the user selects a country area.
布局
Layouts
跳转到“Layouts”Usage
跳转到“Usage”This element must contain one of the following three attributes:
| Property | Description |
|---|---|
| areacode | Indicates data of the phone code |
| country | Indicates data of the country |
| province | Indicates data of the province |
If the element has an areacode or province attribute, it needs to specify a country-id attribute to the spz-area with a country attribute.
country-id: A string of thespz-areaID with acountryattribute.
<spz-area country id="country" layout="container">
<select name="country_code" value="" required>
<option empty value="" selected disabled>Country</option>
</select>
</spz-area>
<spz-area province layout="container" country-id="country">
<select name="province_code" value="">
<option empty value="" selected disabled>Province</option>
</select>
<input type="hidden" name="province" value="">
</spz-area>
<spz-area areacode layout="container" country-id="country">
<select name="phone_area_code" value="">
<option empty value="" selected disabled>Area code</option>
</select>
</spz-area>
Attributes
跳转到“Attributes”src
跳转到“src”You can use URL or script:#script_id to get data. Reference to Src attribute usage.
Actions
跳转到“Actions”update
跳转到“update”| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
| code | Specify the type of change field: areacode is phone_key, country is iso_code_2, province is code |
string | - | - |
| type | Specify the type. Optional: areacode | country | province |
string | - | Yes |
Events
跳转到“Events”update
跳转到“update”Be automatically triggered when a <select> of the element is changed or the user calls the update action.
areaChange
跳转到“areaChange”Be automatically triggered when a <select> of the element is changed.