What is the correct method for globally registering and utilizing the Vue Rangedate Picker component?

Struggling with integrating VueRangedatePicker into a template for another Vue component. Using Webpack, already registered the component/plugin in main.js:

import Vue from 'vue'
import App from './App'
import router from './router'
import { store } from './store/store'
import firebase from './firebase-config'
import vuefire from 'vuefire'

//////////////// Registered component here
import VueRangedatePicker from 'vue-rangedate-picker' // imported plugin
Vue.use(VueRangedatePicker) // used it
Vue.component('VueRangedatePicker', {  }) // globally created component (to prevent registration error)
////////////////

Vue.config.productionTip = false
let app;
Vue.use(vuefire)

// Firebase authentication check
firebase.auth().onAuthStateChanged(function(user){
  if (!app) {
    /* eslint-disable no-new */
    app = new Vue({
      el: '#app',
      template: '<App/>',
      components: { App, VueRangedatePicker },
      router,
      store,
      VueRangedatePicker
    })
  }
})

In component_A.vue, VueRangedatePicker is imported again:

<template>
  <div>
       <vue-rangedate-picker @selected="onDateSelected" i18n="EN" />
  </div>
</template>
<script>
import firebase,{ itemRef } from '../firebase-config';
import VueRangedatePicker from 'vue-rangedate-picker'

export default {
firebase() { 
    return {
    items: itemsRef,
    }
  },
  name: 'component_A',
  data () {
    return {

    }
  },
created() {  
  console.log(VueRangedatePicker);
},
methods: {
  onDateSelected: function (daterange) {
    this.selectedDate = daterange
  },
}
</script>

Confirmed registration of VueRangedatePicker by logging object to consolehttps://i.sstatic.net/2t32p.png

Error message encounteredhttps://i.sstatic.net/Yw8Qo.png

Despite reading project's readme.md, confusion persists around Vue_Daterange_picker - plugin or component? How to make it work?

Answer â„–1

The reason for this issue is that the component was registered with a blank name. Within main.js :

Vue.component('DatePicker', VueRangedatePicker)

To use the component in your code, do the following :

<date-picker></date-picker>

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

Problem with synchronized real-time list when fetching data from server in VueJs

My website has a dynamic list feature where users can input text to create new projects. The program sends an HTTP request when the page is loaded for the first time to retrieve all projects for the current user and display them on the screen. Users can al ...

How to Ensure Screen Opens in Landscape Mode with Phaser3

https://i.stack.imgur.com/keCil.pngIn my Phaser3 game, I am trying to achieve the functionality where the game opens horizontally in a webview without requiring the user to rotate their phone. The vertical photo below shows the game in its current state. W ...

Even after assigning the class "img-fluid" to my image, it still fails to properly adjust to the screen size

I added the class "img-fluid" to my image in Bootstrap, but it's not fitting on my webpage. What should I do? <img src="images\406201.jpg" class="img-fluid" alt="..."> <div style="margin-top: 0p ...

Exploring the universal scope in NodeJS Express for each request

I am working with a basic express server that is in need of storing global variables during request handling. Specifically, each request involves multiple operations that require information to be stored in a variable like global.transaction[]. However, u ...

What is the reason behind shadow dom concealing HTML elements when viewed in inspect mode?

https://i.stack.imgur.com/UZM7f.png Monday.com has implemented Shadow Dom to protect its source code. How can I work around this limitation? ...

Display a clock showing the Central Standard Time (CST) on an HTML webpage using

Is there a way to display the current time in CST time format on an HTML page using JavaScript? I need it to be shown in the following format: "02 Jul 2015 10:34:45 PM" ...

Why is my AJAX request not working in conjunction with my on-page JavaScript?

While working on an order confirmation page, I encountered a challenge with an AJAX request that I am making to a page containing JavaScript code for tracking cookies and recording data. Unfortunately, when the request is fired to this other page with the ...

What is the process of transforming JSON data into an object that includes nested objects?

I am looking to utilize my retrieved data to generate a line chart in Vuejs The data I have is: [{"A": 400},{"B": 1597},{"C": 1567}] My Vuejs template code looks like this: <template> <line-chart :data="Myd ...

Instructions on incorporating domains into next.config.js for the "next/image" function with the help of a plugin

Here is the configuration I am currently using. // next.config.js const withImages = require("next-images"); module.exports = withImages({ webpack(config, options) { return config; }, }); I need to include this code in order to allow images from ...

The functionality of Regex in JavaScript is not meeting my expectations

I've come up with a regular expression for Name validation that only allows characters like "_", "-", "'", and "." Here is the regular expression pattern: ^[a-zA-Z][a-zA-Z0-9\.\-_']{1,24}$ The issue is that it's allowing na ...

Using JQuery to locate and substitute occurrences of HTML elements throughout my webpage

Looking for assistance with a JQuery search and replace task involving multiple instances of HTML within a specific DIV element on my webpage. Specifically, I need to change certain items in the textbox to a simpler display format. Here is a snippet of th ...

Is it possible to obtain the socket.id of a user immediately upon their connection?

Does anyone know how I can send a personalized message to a user when they connect, without broadcasting it to everyone else? I'd like to use their socket ID with the code io.to(theirSocketID).emit('chat message', 'Welcome');, but ...

npm issue: unnecessary package: [email protected]

Hi there! I'm currently in the process of learning how to build a website using node.js. At the moment, I have node v4.5.0, npm 2.15.9, and coffeescript 1.10.0 all installed on my system. Following along with the instructions from a book called "Coffe ...

Instructions for transferring the "node_modules" folder using "webpack-node-externals" to a specific directory during production build

Let's talk about a full-stack application project involving a NodeJS back-end. package.json includes dependencies for both front-end (such as vue, vuex, etc.) and back-end (like body-parser, express, etc.). Two entry points are being created - one fo ...

"Unleashing the power of Asynchronous Ajax Operations

$("#container").on("change", "#control1", function() { if ($("#checkData").val()) { $.get("/Controller/CheckData/" + $("#control2").val(), function(data1) { if(!data1.Success) { alert("Unable to do POST."); ...

Encountering a "TypeError: Cannot access the 'state' property of undefined" error while using React's "Map" function

It's clear from the examples below that the first photo functions perfectly when this.state.blabal is NOT located within the map(a, b){blabla} However, as seen in photo2, when I move the functioning block inside the map(a, b){`here!!`} {Object.k ...

What is preventing me from being able to import a React component from a file?

I've double-checked my code and everything seems correct, but when I view it on the port, only the app.js file is displayed. import React from 'react'; import ImgSlider from './ImgSlider'; import './App.css'; function ...

Determine the number of input tags within a div element by utilizing the closest property in jQuery

Sorry for the silly question, but I've been struggling to find a solution. Spent hours scratching my head. Here is my HTML structure: <div class= 'container'> <div class="someclass"> <input>some content</in ...

Using Javascript calls with the Ajax WebMethod technique

I've been facing issues running a JavaScript program on my online server. I'm considering another approach: Using Ajax WebMethod with JavaScript calls: <script type="text/javascript"> function gettime(){ var hour = new Date(). ...

Changing the user object stored in the database within the next authentication process following registration

In my next.js application, I have implemented Next Auth for authentication and used a database strategy. Once a user logs in, is there a way to update their data? ...