Git Product home page Git Product logo

Comments (5)

shuanger051 avatar shuanger051 commented on September 26, 2024

点击确定和取消按钮的时候可以这样操作
$(document).on("touchstart",".lcalendar_finish",callback) 在callback中处理就可以了。

from lcalendar.

DorisOu avatar DorisOu commented on September 26, 2024

能具体一点么?

from lcalendar.

shuanger051 avatar shuanger051 commented on September 26, 2024

这个只能添加监听事件,进行处理。我看了下这个插件的源码,里面封装了".lcalendar_finish"这个样式作为按钮的样式。所以要在这个样式上添加监听事件,$(document).on("touchstart",".lcalendar_finish",**callback**) 这样就为这个样式添加了监听‘touchstart’(因为原框架中点击按钮的时候调用的是这个事件)。这样在自己选中日期点击确定按钮的时候,就会执行自己定义的callback方法,callback方法里面自定义自己取值的function就可以了。我自己的代码如下:(我使用的vue2.0框架)

$(document).on("touchstart",".lcalendar_finish",this.initDateInputVal)
initDateInputVal : function (){
              let _self = this;
              _self.beginTime = $("#start_date").val();
              _self.endTime = $("#end_date").val();
              _self.page = 1;
              _self.npInfoList = [];
              _self.$nextTick(() => {
                _self.$refs.infiniteLoading.$emit('$InfiniteLoading:reset');
              });
          }

from lcalendar.

DorisOu avatar DorisOu commented on September 26, 2024

非常感谢,
image
像这种,用datetime怎样把时分放到后面显示,不想用单独的date和time控制,这样加好多判断来判断用户选取的时间

from lcalendar.

shuanger051 avatar shuanger051 commented on September 26, 2024

这个我没用过哦。非常抱歉。不过我建议你分开控制。

from lcalendar.

Related Issues (20)

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.