element-ui的el-date-picker组件报错“Avoid mutating a prop directly since the value”

157 阅读1分钟

安装的是这个版本的 "element-ui": "^2.4.5",

使用是这么使用的

 <el-date-picker
               type="daterange"
              v-model="date"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              size="small"
              :picker-options="pickerOptions"
            ></el-date-picker>
 data () {
    return {
      activeIndex: '1', // 把菜单项默认选中状态定义出来
      radioSelect: '今日',
      date: null,
      pickerOptions: {
        shortcuts: [
          {
            text: '最近一周',
            onClick (picker) {}
          },
          {
            text: '最近一个月',
            onClick (picker) {}
          },
          {
            text: '最近三个月',
            onClick (picker) {}
          }
        ]
      }
    }
  },
  methods: {
    onMenuSelect (index) {
      // 当修改menu选择时
      // index就是我们点击菜单项的index
      this.activeIndex = index
    }
  }

报错如下:

image.png

未解决。