Giter Site home page Giter Site logo

wxapp_choose_city's Introduction

本插件已开源:https://github.com/zh28/wxapp_choose_city

属性

属性 类型 默认值 说明
haveHistory Boolean true 是否需要显示历史选择一栏
bindconfirm Function none 点击“完成”后的回调

回调参数

属性 类型 说明
code Number 地区编码
firstChar String 拼音首字母
name String 城市名称
rank Number ----
subLevelModeList null null

示例

  • app.json

    {
        "plugins": {
            "chooseCity": {
                "version": "1.0.0",
                "provider": "wxcdf8cca1bde64773"
            }
        }
    }
  • index.json

    {
        "navigationBarTitleText": "选择城市",
        "usingComponents": {
            "city-choose": "plugin://chooseCity/citys"
        }
    }
  • index.wxml

    <city-choose have-history="{{false}}" catch:confirm="confirm" />
  • index.js

    Page({
        confirm({ detail }) {
            console.log(detail);
            /*
            输出:
            {
                code: 101280600,
                firstChar: "s",
                name: "深圳",
                rank: 0,
                subLevelModelList: null
            }
            */
        }
    });

预览

预览图

wxapp_choose_city's People

Contributors

zhcode-fun avatar

Watchers

James Cloos 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.