Skip to content

Select

Select mode, the most traditional and classic application form

Component reference

Referencing components in your project

js
import { RegionSelects, RegionFullSelects } from 'v-region'

Examples

Close city level, only select province

template
<RegionSelects language="en" :city="false" />

Close area level

template
<RegionSelects language="en" :area="false" />

3-level administrative divisions

template
<RegionSelects language="en" />

Use full 4-level administrative divisions

v-model value
Change event response results
{}
template
<RegionFullSelects language="en" />

Initial value binding

Specify a set of region code values ​​so that the component displays those regions by default

template
<RegionFullSelects v-model="region" />
ts
import { ref } from 'vue'
import { RegionFullSelects } from 'v-region'
import type { RegionValues } from 'v-region'
const region = ref<RegionValues>({
  province: '350000',
  city: '350100',
  area: '350104',
  town: '350104008'
})

Clear/Reset

Specify an object with the value of undefined at each level to clear it

js
region.value = {
  province: undefined,
  city: undefined,
  area: undefined,
  town: undefined
}

WARNING

Passing an undefined value or an empty object {} does not clear

Disabled state

Disable a component so that it cannot be interacted with

template
<RegionFullSelects
  v-model="values"
  :disabled="true"
/>

Released under the MIT License.