vue-ydui icon indicating copy to clipboard operation
vue-ydui copied to clipboard

dateTime组件初始化失败

Open jixuanyu opened this issue 6 years ago • 0 comments

问题描述

dateTime组件在ios端报错,无法绑定默认时间

产生环境

ios手机端 dateTime组件初始化赋值失败

  • **使用版本:1.2.2
  • **引入方式: NPM
  • **演示地址:-

提示错误信息

[Vue warn]: Invalid prop: custom validator check failed for prop "value".

found in

---> <YdDatetime> <SelectMenu> at src\components\selectMenu.vue <OneSales> at src\pages\3-sales\oneSales.vue <SalesPage> at src\pages\3-sales\salesPage.vue <App> at src\App.vue <Root>

代码区域

<script>
    created() {
    this.endTime= this.$store.state.dataTime.slice(0, 7);
    if (this.childMsg.type == 2) {
      this.$store.state.dataTime2 = this.$store.state.dataTime1;
    }
    this.datetime =
      this.childMsg.type == 2
        ? this.$store.state.dataTime1.slice(0, 7)
        : this.$store.state.dataTime2.slice(0, 7);
    this.datetime += "-01";
    this.dateTime =
      this.datetime.slice(0, 4) + "年" + this.datetime.slice(5, 7) * 1 + "月";
  },
</script>

jixuanyu avatar Sep 28 '18 01:09 jixuanyu