When trying to search for 'elForm' using the 'in' operator within the context of a "datetime" type, the error "Unable to find 'elForm' in undefined" occurs

I am attempting to implement a datepicker with time options from Element UI. I am encountering an issue within the ElementUI component. It functions correctly if the type option is set as date, but throws an error with datetime. Below is my code snippet and the error message.

import { cloneDeep } from 'lodash';

export default {
  name: 'actions',
  components: {},
  props: {
    data: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      indentData: {
        reported_at: '',
      },
    };
  },
  computed: {
    validToPickerOptions() {
      const endOfDay = new Date(new Date().setHours(23, 59, 59, 999));
      return {
        disabledDate(time) {
          return (time >= endOfDay);
        },
      };
    },
  },
  methods: {
    reportMarkReported() {
      console.log('this.indentData', this.indentData);
      this.$emit('save-report-release', this.indentData);
    },
  },
  created() {
    this.indentData = cloneDeep(this.data);
  },
};
<template>
  <div>
  <div class="action">
    <button @click="reportMarkReported">
      Submit
    </button>
  </div>
  <div>
    <el-date-picker
      v-model="indentData.reported_at"
      type="datetime"
      format="dd MMM 'yy hh:mm A"
      placeholder="Pick a Date"
      size="small"
    />
    </div>
  </div>
</template>

Upon clicking on the element, here is the error I am encountering

vue.esm.js?b66f:1741 TypeError: Cannot use 'in' operator to search for 'elForm' in undefined
    at resolveInject (vue.esm.js?efeb:4649:1)
    at initInjections (vue.esm.js?efeb:4619:1)
    at Vue._init (vue.esm.js?efeb:4710:1)
    at new VueComponent (vue.esm.js?efeb:5836:1)
    at createComponentInstanceForVnode (vue.esm.js?b66f:4310:1)
    at init (vue.esm.js?b66f:4131:1)
    at createComponent (vue.esm.js?b66f:5608:1)
    at createElm (vue.esm.js?b66f:5555:1)
    at createChildren (vue.esm.js?b66f:5682:1)
    at createElm (vue.esm.js?b66f:5584:1)
vue.esm.js?b66f:591 [Vue warn]: Error in nextTick: "TypeError: Cannot read properties of undefined (reading '$el')"
TypeError: Cannot read properties of undefined (reading '$el')
    at Vue.eval (element-ui.common.js?bc95:18396:1)
    at Array.eval (vue.esm.js?b66f:1837:1)
    at flushCallbacks (vue.esm.js?b66f:1758:1)

Answer №1

Success! After upgrading my element-ui to version 2.15, the issue was resolved. This bug has been addressed in the latest release.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Seeking an efficient method to quickly bring in the commonly utilized elements within a component?

Is there an efficient method for importing commonly used components? Every time I create a new component, I have to manually import and register each required component individually like this: import MyButton from './myButton' import MyInput fr ...

Dynamic route fails to return value for ID search

Currently, I am testing by creating an array of users containing their respective IDs and names. There is also a button that triggers an onclick function to add the element's ID to the page's URL in order to establish a dynamic route. However, wh ...

Select the Best jQuery Package

Having a variety of packages available for selection. <div class="image-grid-item" data-search="select"> <input name="pack1" type="checkbox" style="display: none;"> </div> <div class="image-grid-item" data-search="select"> <inp ...

Problem with exporting data from the API to a JavaScript file in Excel format

Instead of receiving actual data in the response, I am getting a set of characters. However, everything works fine when I click on Download file in swagger. Can someone help me diagnose the issue? function downloadDocFile(data: Blob, ext = 'xlsx' ...

Packages have gone astray post node_modules scrub

I encountered an issue with npm run watch getting stuck at 10%, so I took the step of deleting the node_modules directory and package-lock.json. However, it seems that I may have installed modules using npm install without the --save-dev option. Even after ...

Refresh gif without having to reload it in Internet Explorer 11

I'm attempting to create a feature where a gif restarts when clicked by the user, without needing to reload it (due to the heavy size of the gif which is preloaded for my application). The current code functions flawlessly on Chrome and other "modern ...

How to enable Autocomplete popper to expand beyond the menu boundaries in Material UI

Within my Menu component, I have an Autocomplete element. When the Autocomplete is clicked, the dropdown list/Popper appears but it's confined within the Menu parent. How can I make it so that the Autocomplete's dropdown list/Popper isn't re ...

The presence of an unauthorized token within the meteor/node module has been detected, specifically related

While following g00glen00b's tutorial on meteor/twitter integration (), I encountered a persistent error. Any assistance or clues would be greatly appreciated. Steps I've Taken Uninstall/reinstall npm Uninstall/reinstall twitter package Uninst ...

Error: doc.data().updatedAt?.toMillis function is not defined in this context (NextJs)

I encountered an error message while trying to access Firestore documents using the useCollection hook. TypeError: doc.data(...)?.updatedAt?.toMillis is not a function Here is my implementation of the useCollection Hook: export const useCollection = (c, q ...

The variable process.env.CLIENT_ID is functioning correctly within a function, but does not work when declared as a global

Trying to implement oAuth for Google API Using .env file to hide sensitive variables with .gitignore Facing an issue when trying to define the CLIENT_ID variable globally CLIENT_ID = process.env.CLIENT_ID When I run and log the variable outside of a fun ...

Leveraging jQuery's .when and .then methods allows for

I'm attempting to utilize a shared ajax function that is meant to retrieve the value returned from the PHP script. function fetchAjax(url, data, type) { result = 0; $.when( $.ajax({ type: "POST", url: url, data: data, ...

Effortlessly create a seamless transition in background color opacity once the base image has finished

I've set up a div with a sleek black background. Upon page load, I trigger an API request for an image, which is then displayed in a secondary div positioned behind the main one. After this, I aim to smoothly transition the overlaying div's opaci ...

The async and await functions do not necessarily wait for one another

I am working with Typescript and have the following code: import sql = require("mssql"); const config: sql.config = {.... } const connect = async() => { return new Promise((resolve, reject) => { new sql.ConnectionPool(config).connect((e ...

Avoid reactivating focus when dismissing a pop-up menu triggered by hovering over it

I am currently utilizing @material-ui in conjunction with React. I have encountered the following issue: In my setup, there is an input component accompanied by a popup menu that triggers on mouseover. Whenever the menu pops up, the focus shifts away from ...

Creating a sequence of HTTP calls that call upon themselves using RxJs operators

When retrieving data by passing pageIndex (1) and pageSize (500) for each HTTP call, I use the following method: this.demoService.geList(1, 500).subscribe(data => { this.data = data.items; }); If the response contains a property called isMore with ...

Issue with People Picker directive causing AngularJS validation to fail

I have implemented a SharePoint client-side people picker in my form using the directive from this GitHub repository. However, I am facing an issue where the validation of my form fails and the button remains disabled. When I remove the field, the validati ...

Guide on integrating AJAX with servlets and JSP for database-driven applications

What is the best way to integrate AJAX technology with servlets and JSP for a database application? I am currently developing a JSP page that makes calls to JavaScript. The JavaScript then calls a servlet where the database is accessed. How can I pass th ...

Discontinuing the mobx autorun feature upon componentWillUnmount

In my componentDidMount, I have the following autorun function: componentDidMount() { this.autoUpdate = autorun(() => { this.setState({ rows: generateRows(this.props.data) }) }) } Unfortunate ...

Error in defining class variable within the constructor not found

Just started delving into CoffeeScript and facing a challenge. In my code snippet below, I initialize WebSocketServer with a number as the first argument and a function as the second argument. However, when the websocket receives a message, @msgHandler sud ...

"An error occurs when trying to trigger a .click() event within a list element

There is a list that can contain either plain text or a link. If there is a link present, the entire list element should be clickable. When attempting to execute the following code: if ($('.link').length) { $('li[data-contains-link]' ...