Giter Site home page Giter Site logo

wx_selectarea's Introduction

Codacy Badge Dependency status Build Status GitHub issues

wx_selectArea

地址联动选择器采用微信小程序的 picker-view 组件

模板引入

提供 template 模板引入

  1. 引入wxmlwxss
// example.wxml
<import src="../../template/index.wxml"/>
<template is="areaPicker" data="{{...areaPicker}}" />

// example.wxss
@import '../../template/index.wxss';
  1. 组件初始化
// example.js

import initAreaPicker, { getSelectedAreaData } from '../../template/index';
Page({
	onShow: () => {
    initAreaPicker({
      // hideDistrict: true, // 是否隐藏区县选择栏,默认显示
    });
  },
	getSelecedData() {
		console.table(getSelectedAreaData()); // 提供`getSelectedAreaData`方法,返回当前选择的省市区信息组成的数组
	}
});

截图

旧版

小程序不支持 picker-view 组件时,用 scroll-view 模拟的联动选择器(不再维护)

欢迎反馈...

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.