Code Monkey home page Code Monkey logo

vue-address-picker's Introduction

作者:Alan Chen

address-picker

基于vue编写的移动端地址三级联动,直接导入组件,不依赖任何第三方组件或插件,需要用脚手架导入,因为是vue单页文件

  • 注意:仓库中的address-data.js为地址的数据,必须和组件在同一级目录 avatar

调用方法:

  • 1.必须传一个props:'addressShow',布尔值,控制地址选择器显示与否
  • 2.自定义okcancel事件,表示当address-picker组件点击确定按钮和取消按钮的操作
  • 3.ok事件将当前选中的省市区传给父组件事件,cancel事件让父组件的addressShow值变为false

使用demo

<address-picker :addressShow="addressShow" @ok="ok" @cancel="addressShow=false"></address-picker>
//在父组件ok自定义事件中回调传入的是一个对象
{province:'天津市',city:河西区,town:''});//键名分别在左侧,如果town没有则返回一个空字符串

vue-address-picker's People

Contributors

alanchenchen avatar

Watchers

James Cloos avatar Loren.Wang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.