112
v-region — 基于 Vue2 的中国行政区划选择器
source link: https://www.oschina.net/p/v-region?amp%3Butm_medium=referral
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
v-region
基于 Vue2 的简洁、易用的中国行政区划选择器,包含常规表单下拉列表模式和UI下拉选择器模式;支持 “省/直辖市”-“市”-“区/县”-“乡/镇/街道”4级行政级别
实例、文档
插件预览
基础表单模式
选择器模式
安装插件
npm install v-region --save
在入口文件 main.js
中导入插件
import Vue from 'vue' import vRegion from 'v-region'; Vue.use(vRegion);
在你的页面中使用(基础模式)
template code
<template> <v-region @values="regionChange" class="form-control"></v-region> </template>
script code
export default { methods:{ //receive selected region data regionChange(data){ console.log(data); } } };
Data Source
region data com from repo: mumuy/data_location
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK