Vuepic / vue-datepicker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
1.52k stars 152 forks source link

Failed to resolve component: vuedatepicker #720

Closed ljz572000 closed 10 months ago

ljz572000 commented 10 months ago

Hi guys,

Since I need to build a new page using Vue3 that include a new datapicker component, I have a issue unable to perform normally.

the information shown in the console.

[Vue warn]: Failed to resolve component: vuedatepicker
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://unpkg.com/@vuepic/vue-datepicker@latest/dist/main.css">
</head>
<body>

<script src="https://unpkg.com/vue@latest"></script>
<script src="https://unpkg.com/@vuepic/vue-datepicker@latest"></script>
<div id="app">
  {{ message }}
  <VueDatePicker ></VueDatePicker>
</div>

<script>
  const { createApp, ref, onMounted, onUnmounted } = Vue;

  createApp({
    components: { Datepicker: VueDatePicker },
    setup() {
      const message = ref("Hello vue!");
      onMounted(() => {
        console.log(`the component is now mounted.`);
      });
      return {
        message,
      };
    },
  }).mount("#app");
</script>
</body>
</html>
Jasenkoo commented 10 months ago

The documentation has the wrong example, In the HTML part, instead VueDatePicker use Datepicker, or just replace components: { Datepicker: VueDatePicker }, with components: { VueDatePicker },