Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datepicker time 初始化时间展示异常 #316

Open
sevenT opened this issue Aug 15, 2018 · 0 comments
Open

datepicker time 初始化时间展示异常 #316

sevenT opened this issue Aug 15, 2018 · 0 comments

Comments

@sevenT
Copy link

sevenT commented Aug 15, 2018

版本号: vue-beauty-2.0.0-beta.14, vue-beauty-2.0.0-beta.19
问题描述:

       异步初始化datePicker时, ftime = 2018-08-16 17:35:35 渲染之后ftime变成了 2018-08-16 00:00
       vue-beauty的date-picker组件会默认将日期之后的 小时和分钟变成00:00
       `<v-date-picker v-model="ftime" clearable show-time ></v-date-picker>`

复现代码:

<html>
    <head>
        <link href="vue-beauty.min.css" type="text/css" rel="stylesheet" />
    </head>
    <body>
        <div id="content">
            <v-card title="date-time-picker test">
                <v-date-picker v-model="time" show-time ></v-date-picker>
                <v-input v-model="time" style="margin-top: 15px;width: 150px;" disabled></v-input>
                <v-button @click=changeTime>简单修改time(点两次结果正确)</v-button>  
                <v-button type="primary" @click=changeAndSet>修改并通过nextTick变更</v-button>  
            </v-card>
            
        </div>
        <script type="text/javascript" src="vue.min.js"></script>
        <script type="text/javascript" src="vue-beauty.js"></script>
        <script type="text/javascript">

            var app = new Vue({
                el: "#content",
                data: {
                    time: ""
                },
                methods: {
                    changeTime: function() {
                        this.time = "2018-07-01 12:13:11";
                    },
                    changeAndSet: function() {
                       this.time = "2018-08-01 14:13:11";
                        var vm = this;
                        this.$nextTick(function(){
                            vm.time =  "2018-08-01 14:13:11";
                        });
                    }
                }
            })
        </script>
    </body>
</html> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant