I want to create a date selection form using v-calendar with Vue.js.
https://www.kabanoki.net/3905/
I am trying to create it with reference.
V-calendar should have been installed with npm, but
To make sure that the package is correctly installed in the project,
npm list v-calendar
[email protected]/Users/usename/Desktop/taskcapsule
└── UNMET DEPENDENCY [email protected]
npm ERR! missing: [email protected], required by [email protected]
I came out. So
npm install [email protected]
I was able to confirm the package, but
The following error appears on the Google verification screen.
Uncaught ReferenceError: Vue is not defined
at Module ../ node_modules/babel-loader/lib/index.js?! ./ node_modules/vue-loader/lib/index.js?! ./ app/javascript/packs/components/about.vue? vue&type = script&lang = js&(about.vue: 9)
at __webpack_require__ (bootstrap: 19)
at Module ../ app/javascript/packs/components/about.vue? vue&type = script&lang = js&(about.vue? 8ebb: 1)
at __webpack_require__ (bootstrap: 19)
at Module ../ app/javascript/packs/components/about.vue (about.vue: 1)
at __webpack_require__ (bootstrap: 19)
at Module ../ app/javascript/packs/router/router.js (router.js: 1)
at __webpack_require__ (bootstrap: 19)
at Module ../ app/javascript/packs/todo.js (todo.js: 1)
at __webpack_require__ (bootstrap: 19)
Source code
The contents of the vue file of the component that actually creates the date selection form.
<template>
<v-date-picker: mode = "mode"
: formats = "formats"
v-model = "selectedDate"></v-date-picker>
</template>
<script>
import VCalendar from 'v-calendar';
Vue.use (VCalendar);
Vue.config.productionTip = false
export default {
data: function () {
return {
mode: 'single',
formats: {
input: ['YYYY-MM-DD'],
},
selectedDate: null,
}
}
}
</script>
I'm stuck with an error that I couldn't understand ...
Thank you.
import Vue from 'vue/dist/vue.esm.js'
import Router from './router/router'
import Header from './components/header.vue'
import VCalendar from 'v-calendar';
Vue.use (VCalendar);
Vue.config.productionTip = false
var app = new Vue ({
el: '#app',
router: Router,
components: {
'navbar': Header,
}
});
-
Answer # 1
-
Answer # 2
Vue is not defined
Is not defined.
In most cases, you should read the error statement because the cause is written on the first line.Please refer to a similar question that was answered the other day.
I want to create a date selection form in Vue.js-StackOverflowI think you should take a look at the official introduction methods.
V-Calendar-Installation
Related articles
- vuejs - vuex4 uncaught error: module build failed: error: enoent: no such file or directory, open
- javascript - how to solve uncaught referenceerror: launch is not defined
- php - how to resolve uncaught referenceerror: li is not defined
- javascript - uncaught referenceerror occurs when obtaining external jsonp using $ajax of jquery from within chrome extension
- javascript - [jquery] uncaught referenceerror: $is not defined
- javascript - how to solve uncaught referenceerror: is not defined
- javascript - uncaught (in promise) referenceerror: deletefiles is not defined
- php - ajax response is uncaught referenceerror: *** is not defined
- vuejs - referenceerror: axois is not defined
- javascript - uncaught referenceerror: ons is not defined error
- javascript - how to deal with uncaught referenceerror: $is not defined
- uncaught referenceerror: module is not defined in javascript called chrming
- javascript - frontjs: 8 uncaught referenceerror: browser is not defined appears in the debug console
- javascript - uncaught referenceerror if a string is entered in the argument
- i want to use datepiker with vuejs + rails, but uncaught error: cannot find module"pikaday"appears [detailed source co
- javascript - uncaught referenceerror: category is not defined
- php - about uncaught referenceerror
- javascript - how to solve uncaught referenceerror: com is not defined
- javascript - resolution of uncaught referenceerror: j is not defined
Maybe
Vue
is not defined as the error descriptionSince it looks like a vue file, I think there is a place where
Vue
is defined likeimport Vue from 'vue';
* It looks like there are full-width spaces in the source you put
* Source when confirmed by parcel
index.js
MyApp.vue
Append
After creating a vue.js + typescript project with
vue/cli
, this was done like thismain.ts
※ Even if an error occurs when import is used, it seems that it will eventually move ... It may only be a type error