@halobear/vue region

中国城市选择

Version: 2.0.2 Updated: 09/07/2020

By: halobear License: ISC

Downloads Last 30 Days: 137

Install

npm i @halobear/vue-region
yarn add @halobear/vue-region

Repository: https://github.com/halobear/npm-packages

CDNs

bundle.run: https://bundle.run/@halobear/vue-region

jsDelivr: https://cdn.jsdelivr.net/npm/@halobear/vue-region

unpkg: https://unpkg.com/@halobear/vue-region

@halobear/vue-region

vue 中国城市选择

安装

yarn add @halobear/vue-region

使用

<template>
  <div class="test-container">
    <vue-region changeOnSelect v-model="region" :simple="false" @change="change"></vue-region>
    <p>{{ region_name }}: {{ region.join("、") }}</p>
  </div>
</template>

<script>
  import VueRegion from '@halobear/vue-region'

  export default {
    components: {
      VueRegion,
    },
    data() {
      return {
        region: ['0'],
        region_name: '全国',
      }
    },
    methods: {
      change(value, name) {
        this.region_name = name
      },
    },
  }
</script>

示例

Categories: Vue js
Tags: vue