Git Product home page Git Product logo

Comments (4)

k186 avatar k186 commented on May 18, 2024

@hwyeeee 麻烦提供下完整的代码片段 包括 YearArr的数据 getDateYear的返回值样例。

from pd-select.

hwyeeee avatar hwyeeee commented on May 18, 2024

<template>
<div id="app">
<button @click="getTime">获取时间
<br>
<input type="text" v-model="date">
<br>
<button @click="after">重置时间
<pd-select-box style="position: fixed;bottom: 0;width: 100%">
<pd-select-item ref="year" :listData="yearArr" v-model="year" type="cycle">
<pd-select-item ref="month" :listData="monthArr" v-model="month" type="cycle">
<pd-select-item ref="day" :listData="dayArr" v-model="day" type="cycle">
<pd-select-item ref="hour" :listData="hourArr" v-model="hour" type="cycle">
</pd-select-box>
</div>
</template>

<script> export default { name: 'app', data () { return { yearArr: Array.from({length: 31}, (value, index) => index + 2000), monthArr: Array.from({length: 12}, (value, index) => index + 1), dayArr: Array.from({length: 31}, (value, index) => index + 1), hourArr: Array.from({length: 24}, (value, index) => index), year: '', month: '', day: '', hour: '', date: '' } }, mounted(){ setTimeout(()=>{ this.after() },300) }, methods: { getTime () { this.date = this.year + '-' + this.month + '-' + this.day + ' ' + this.hour }, after () { let curDate = new Date() this.year = curDate.getFullYear() this.month = (curDate.getMonth() + 1) this.day = curDate.getDate() this.hour = curDate.getHours() this.$refs.year.init() this.$refs.month.init() this.$refs.day.init() this.$refs.hour.init() } } } </script>

@k186 ,测试时候的代码

from pd-select.

k186 avatar k186 commented on May 18, 2024

已经修复 安装最新版本就可以了

from pd-select.

hwyeeee avatar hwyeeee commented on May 18, 2024

thanks

from pd-select.

Related Issues (12)

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.