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.

布局

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 the spz-area ID with a country attribute.
<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>

You can use URL or script:#script_id to get data. Reference to Src attribute usage.

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

Be automatically triggered when a <select> of the element is changed or the user calls the update action.

Be automatically triggered when a <select> of the element is changed.

本页目录