Code Monkey home page Code Monkey logo

applet_map_components's Introduction

小程序map组件上实现cover-input 和 cover-select

现在是2019年1月初,小程序官方还没有发布cover-input等组件,在map层级之上可操作的组件只有cover-viewcover-image

cover-input

map组件属于原生组件,层级最高,能在map层级之上可操作的组件只有cover-viewcover-image,现有需求在map组件上层浮现弹框,可输入(input)

在真机上原生input组件嵌在内会被忽略导致

实现方法:控制input的焦点

cover-select

在cover-view标签里实现cover-select是根据点击事件控制select-list的显示和隐藏,在list中选中的item放到显示区

使用data-*共同属性将选中的item传出

关于e.target和e.currentTarget的区别:

  • e.target是返回触发事件的对象
  • e.currentTarget返回的是绑定事件的对象

通常情况下target和currentTarget是一致的,我们只要使用target即可,但有一种情况必须区分这两者的关系,那就是在父子 嵌套的关系中,父元素绑定了事件,单击了子元素(根据事件流,在不阻止事件流的前提下他会传递至父元素,导致父元素的事件处 理函数执行),这时候currentTarget指向的是父元素,因为他是绑定事件的对象,而target指向了子元素,因为他是触发事件的 那个具体对象

applet_map_components's People

Contributors

devillittle avatar

Stargazers

 avatar

Watchers

 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.