Why it seems that jest does not detect scss? - vue.js
I've been working for some days in a unit testing. It seems to work well but it shows some warnings about the scss that I don't know how to solve.
The component is this one:
<template>
<div id="cb-nav-sidebar">
<div class="project-name">
<el-button
:icon="'el-icon-s-' + (!isCollapsed ? 'fold' : 'unfold')"
type="text"
#click="toggle"
/>
<h5 v-show="!isCollapsed" class="bold">{{ project.name }}</h5>
</div>
<NavSidebarMenu
position="top"
:items="menuTop"
:is-collapsed="isCollapsed"
></NavSidebarMenu>
<NavSidebarMenu
position="bottom"
:items="menuBottom"
:is-collapsed="isCollapsed"
></NavSidebarMenu>
</div>
</template>
<script lang="ts" setup>
import { useI18n } from 'vue-i18n'
import { computed } from 'vue'
import { useStore } from 'vuex'
import { useRoute } from 'vue-router'
import NavSidebarMenu from '#/components/NavSidebarMenu.vue'
import { NavSidebarMenuItems } from '#/models/NavSidebarMenu'
import { PROCESS_ENV } from '#/utils/legacy/process-env'
import { getCurrentOrganization, Organizations } from '#/models/Organizations'
const { t } = useI18n({})
const MENU_ITEMS_TOP = [
{
label: 'analysis',
icon: 'el-icon-s-data',
path: '/analysis/',
external: false,
},
{
label: 'compare',
icon: 'el-icon-copy-document',
path: '/benchmark/',
external: true,
},
{
label: 'discovery',
icon: 'el-icon-discover',
path: '/discovery/',
external: false,
},
{
label: 'map',
icon: 'el-icon-location-information',
path: '/map/',
external: true,
},
]
const MENU_ITEMS_BOTTOM = [
{
label: 'categorize',
icon: 'el-icon-s-operation',
path: '/categorize/',
external: true,
},
{
label: 'settings',
icon: 'el-icon-setting',
path: '/project-settings/',
external: true,
},
{
label: 'export_data',
icon: 'el-icon-download',
path: '/export_data/export_data/export_csv',
external: true,
},
]
const store = useStore()
const route = useRoute()
let isCollapsed = false
// TODO: avoid duplicated code in TopNavBar.vue
const project = computed(() => {
return store.getters['project/getCurrent']
})
const projectHasMap = computed(() => {
const value = project.value
return value.options['settings:has_map'] === '1'
})
const projectHasBenchmark = computed(() => {
const value = project.value
return value.datasets.length > 4
})
const menuTop = computed(() => {
return makeMenuItems(availableMenuItemsTop)
})
const menuBottom = computed(() => {
return makeMenuItems(availableMenuItemsBottom)
})
const orgPath = computed(() => {
const orgSlug = route.params.orgSlug
const prjSlug = route.params.prjSlug
return `/organization/${orgSlug}/project/${prjSlug}`
})
const externalOrgPath = computed(() => {
const orgSlug = route.params.orgSlug
const prjSlug = route.params.prjSlug
return PROCESS_ENV.legacyUrl + `/organization/${orgSlug}/${prjSlug}`
})
function toggle() {
// HACK: toggle disabled -> todo layout width should change when menu is collapsed
// this.isCollapsed = !this.isCollapsed
isCollapsed = false
}
function makeMenuItems(items: NavSidebarMenuItems[]) {
return items.map((item) => {
const orgPathFinal = item.external ? externalOrgPath.value : orgPath.value
return {
...item,
label: t(`components.project_sidebar.menu.${item.label}`),
section: item.path,
path: `${orgPathFinal}${item.path}`,
}
})
}
function getAvailableMenuItemsTop() {
const items: NavSidebarMenuItems[] = []
MENU_ITEMS_TOP.forEach((item: any) => {
if (item.label === 'map' && !projectHasMap.value) {
return
}
if (item.label === 'compare' && !projectHasBenchmark.value) {
return
}
items.push(item)
})
return items
}
function getAvailableMenuItemsBottom() {
const items: NavSidebarMenuItems[] = []
const organizations: Organizations = route?.meta
?.organizations as Organizations
const organization = getCurrentOrganization(
organizations,
route.params.orgSlug as string
)
const userRole = organization.role
MENU_ITEMS_BOTTOM.forEach((item: any) => {
if (
(item.label === 'categorize' || item.label === 'settings') &&
userRole === 'viewer'
) {
return
}
items.push(item)
})
return items
}
const availableMenuItemsTop = getAvailableMenuItemsTop()
const availableMenuItemsBottom = getAvailableMenuItemsBottom()
</script>
<style lang="scss">
#cb-nav-sidebar {
overflow: hidden;
height: calc(100vh - 76px);
display: flex;
flex-direction: column;
.project-name {
padding: 1.3px 10px;
display: flex;
align-items: center;
border-bottom: 1px solid var(--color-tertiary-400);
h5 {
font-size: var(--font-size--body);
font-family: 'Roboto-Bold';
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
button {
display: flex;
margin-right: 8px;
i {
padding-left: 4px;
font-size: var(--font-size--headline);
color: var(--color-primary-800);
}
}
}
}
</style>
While the test is the following:
import { render } from '#tests/app-test-utils'
import '#testing-library/jest-dom'
/* eslint #typescript-eslint/no-var-requires: "off" */
let mockStoreCommit: jest.Mock
const renderComponent = (getters: any) => {
const ProjectNavSidebar = require('./ProjectNavSidebar.vue').default
jest.mock('vuex', () => ({
...jest.requireActual('vuex'),
useStore: () => ({
getters: getters,
commit: mockStoreCommit,
}),
}))
jest.mock('vue-router', () => ({
useRoute: () => ({
params: {
orgSlug: 'test',
},
meta: {
organizations: [{ slug: 'test' }, { slug: 'test2' }],
},
}),
}))
render(
ProjectNavSidebar,
{},
{
props: {
type: 'categories',
menuType: 'checkbox',
items: [
{
box_templates: '',
id: '1',
name: 'Culture',
},
{
box_templates: '',
id: '2',
name: 'Economy',
},
{
box_templates: '',
id: '3',
name: 'Education',
},
],
},
}
)
}
describe('NavSidebarMenu', () => {
beforeEach(() => {
jest.resetModules()
})
it('renders', () => {
renderComponent({
['project/getCurrent']: {
options: { 'setting:has_map': '1' },
datasets: ['dataset_1', 'dataset_2', 'dataset_3'],
},
})
})
})
The error that appears when testing:
console.warn
[Vue warn]: resolveComponent can only be used in render() or setup().
185 | overflow: hidden;
186 | height: calc(100vh - 76px);
> 187 | display: flex;
| ^
188 | flex-direction: column;
189 | .project-name {
190 | padding: 1.3px 10px;
at warn (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:6799:17)
at resolveAsset (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5515:9)
at resolveComponent (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5463:12)
at Proxy.render (src/components/project/ProjectNavSidebar.vue:187:59)
at renderComponentRoot (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:754:44)
at ReactiveEffect.componentUpdateFn [as fn] (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4469:57)
at ReactiveEffect.run (node_modules/#vue/reactivity/dist/reactivity.cjs.js:164:29)
console.warn
[Vue warn]: withDirectives can only be used inside render functions.
193 | border-bottom: 1px solid var(--color-tertiary-400);
194 |
> 195 | h5 {
| ^
196 | font-size: var(--font-size--body);
197 | font-family: 'Roboto-Bold';
198 | white-space: nowrap;
at warn (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:6799:17)
at withDirectives (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:3291:9)
at Proxy.render (src/components/project/ProjectNavSidebar.vue:195:38)
at renderComponentRoot (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:754:44)
at ReactiveEffect.componentUpdateFn [as fn] (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4469:57)
at ReactiveEffect.run (node_modules/#vue/reactivity/dist/reactivity.cjs.js:164:29)
at setupRenderEffect (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4595:9)
console.warn
[Vue warn]: resolveComponent can only be used in render() or setup().
57 | height: 100%;
58 | &.el-menu {
> 59 | .el-menu-item {
| ^
60 | text-align: left;
61 | }
62 | }
at warn (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:6799:17)
at resolveAsset (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5515:9)
at resolveComponent (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5463:12)
at Proxy.render (src/components/NavSidebarMenu.vue:59:62)
at renderComponentRoot (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:754:44)
at ReactiveEffect.componentUpdateFn [as fn] (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4469:57)
at ReactiveEffect.run (node_modules/#vue/reactivity/dist/reactivity.cjs.js:164:29)
console.warn
[Vue warn]: resolveComponent can only be used in render() or setup().
58 | &.el-menu {
59 | .el-menu-item {
> 60 | text-align: left;
| ^
61 | }
62 | }
63 | &.el-menu--collapse {
at warn (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:6799:17)
at resolveAsset (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5515:9)
at resolveComponent (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5463:12)
at Proxy.render (src/components/NavSidebarMenu.vue:60:57)
at renderComponentRoot (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:754:44)
at ReactiveEffect.componentUpdateFn [as fn] (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4469:57)
at ReactiveEffect.run (node_modules/#vue/reactivity/dist/reactivity.cjs.js:164:29)
console.warn
[Vue warn]: Invalid VNode type: Symbol(Fragment) (symbol)
at <Anonymous position="top" items= [
{
label: 'components.project_sidebar.menu.analysis',
icon: 'el-icon-s-data',
path: '/organization/test/project/undefined/analysis/',
external: false,
section: '/analysis/'
},
{
label: 'components.project_sidebar.menu.discovery',
icon: 'el-icon-discover',
path: '/organization/test/project/undefined/discovery/',
external: false,
section: '/discovery/'
}
] is-collapsed=false >
at <Anonymous type="categories" menuType="checkbox" items= [
{ box_templates: '', id: '1', name: 'Culture' },
{ box_templates: '', id: '2', name: 'Economy' },
{ box_templates: '', id: '3', name: 'Education' }
] ... >
at <VTUROOT>
at warn (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:6799:17)
at patch (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:3951:21)
at mountChildren (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4127:13)
at mountElement (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4037:17)
at processElement (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4019:13)
at patch (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:3939:21)
at ReactiveEffect.componentUpdateFn [as fn] (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4476:21)
console.warn
[Vue warn]: resolveComponent can only be used in render() or setup().
57 | height: 100%;
58 | &.el-menu {
> 59 | .el-menu-item {
| ^
60 | text-align: left;
61 | }
62 | }
at warn (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:6799:17)
at resolveAsset (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5515:9)
at resolveComponent (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5463:12)
at Proxy.render (src/components/NavSidebarMenu.vue:59:62)
at renderComponentRoot (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:754:44)
at ReactiveEffect.componentUpdateFn [as fn] (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4469:57)
at ReactiveEffect.run (node_modules/#vue/reactivity/dist/reactivity.cjs.js:164:29)
console.warn
[Vue warn]: resolveComponent can only be used in render() or setup().
58 | &.el-menu {
59 | .el-menu-item {
> 60 | text-align: left;
| ^
61 | }
62 | }
63 | &.el-menu--collapse {
at warn (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:6799:17)
at resolveAsset (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5515:9)
at resolveComponent (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:5463:12)
at Proxy.render (src/components/NavSidebarMenu.vue:60:57)
at renderComponentRoot (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:754:44)
at ReactiveEffect.componentUpdateFn [as fn] (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4469:57)
at ReactiveEffect.run (node_modules/#vue/reactivity/dist/reactivity.cjs.js:164:29)
console.warn
[Vue warn]: Invalid VNode type: Symbol(Fragment) (symbol)
at <Anonymous position="bottom" items= [
{
label: 'components.project_sidebar.menu.categorize',
icon: 'el-icon-s-operation',
path: 'http://localhost:8000/organization/test/undefined/categorize/',
external: true,
section: '/categorize/'
},
{
label: 'components.project_sidebar.menu.settings',
icon: 'el-icon-setting',
path: 'http://localhost:8000/organization/test/undefined/project-settings/',
external: true,
section: '/project-settings/'
},
{
label: 'components.project_sidebar.menu.export_data',
icon: 'el-icon-download',
path: 'http://localhost:8000/organization/test/undefined/export_data/export_data/export_csv',
external: true,
section: '/export_data/export_data/export_csv'
}
] is-collapsed=false >
at <Anonymous type="categories" menuType="checkbox" items= [
{ box_templates: '', id: '1', name: 'Culture' },
{ box_templates: '', id: '2', name: 'Economy' },
{ box_templates: '', id: '3', name: 'Education' }
] ... >
at <VTUROOT>
at warn (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:6799:17)
at patch (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:3951:21)
at mountChildren (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4127:13)
at mountElement (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4037:17)
at processElement (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4019:13)
at patch (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:3939:21)
at ReactiveEffect.componentUpdateFn [as fn] (node_modules/#vue/runtime-core/dist/runtime-core.cjs.js:4476:21)
Taking into account the logs, it seems like jest does not detect very well the scss part. It is related to how jest is configurated?
Here the jest.config:
module.exports = {
transform: {
'^.+\\.(ts)$': 'ts-jest',
'^.+\\.vue$': 'vue3-jest',
'\\.[jt]sx?$': 'babel-jest',
'.+\\.(css|styl|less|sass|scss|png|jpg|svg|ttf|woff|woff2|webp)$':
'jest-transform-stub',
},
transformIgnorePatterns: ['/node_modules/(?!vue-awesome)'],
moduleNameMapper: {
'^#/(.*)$': '<rootDir>/src/$1',
'^#tests/(.*)$': '<rootDir>/tests/$1',
},
moduleFileExtensions: ['js', 'ts', 'vue', 'json'],
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/components/**/*.vue',
'<rootDir>/pages/**/*.vue',
],
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/tests/setup.js'],
testPathIgnorePatterns: ['tests'],
globalSetup: '<rootDir>/tests/global-setup.js',
}
Thanks!
Related
How to remove line over the stroke line in area chart - Apexchart?
How to remove line over the stroke line in area chart - Apexchart. the image Please help me to fix this! Here is my code so far <template> <div id="chart"> <apexchart ref="pricesRef" type="area" height="150" :options="options" :series="series" ></apexchart> <!-- <button #click="updateSeries">click</button> --> </div> </template> <script> import { axios } from 'boot/axios'; // import { dates, prices } from 'src/services/area-chart'; import { date } from 'quasar'; function formatNumber2(number, tofix) { const val = (number / 1).toFixed(tofix).replace(',', ' '); return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); } let sharePrice = []; const dataSharePrice = []; export default { name: 'AreaChart', data() { return { timeInterval: 0, dataSharePrice: [], series: [ { name: 'Share Price', data: [ // { x: dates[0], y: prices[1] }, // { x: 1602392287529, y: 0.05 }, ], date: [], }, ], options: { chart: { type: 'area', zoom: { enabled: false, }, toolbar: { show: false, }, sparkline: { enabled: true, }, }, tooltip: { custom({ series, w, dataPointIndex }) { const unixTime = w.config.series[0].data[dataPointIndex].x; const timeStamp = new Date(unixTime * 1000); const hour = date.formatDate(timeStamp, 'DD MMMM'); return ( ` <div class="arrow_box_tooltip q-pa-md"> <span class="text-h6"> Date: ${hour}</span> <br /> <span class="text-h6"> Share Price: $${formatNumber2( series[0][dataPointIndex], 0, )} USD</span> </div> ` ); }, }, noData: { text: 'Loading...', }, dataLabels: { enabled: false, }, stroke: { curve: 'smooth', lineCap: 'butt', colors: undefined, width: 2, }, title: { text: '', align: 'left', }, grid: { show: false, }, xaxis: { type: 'datetime', }, yaxis: { opposite: true, }, legend: { horizontalAlign: 'left', }, }, }; }, computed: {}, methods: { getData() { axios .get( 'apiurl', ) .then((response) => { // console.log(response.data.prices); sharePrice = response.data.prices; }) .catch((err) => { console.log(err); }); }, updateSeriesData() { for (const price of sharePrice) { const unixTime = price[0]; if (Object.keys(price).length > 0) { dataSharePrice.push({ x: unixTime, y: price[1], }); } else { dataSharePrice.push({}); console.log('err'); } // console.log(price[0], price[1]); } // console.log(dataSharePrice); this.series[0].data = dataSharePrice; this.$refs.pricesRef.updateSeries([ { data: dataSharePrice, }, ]); // console.log(this.$refs); }, // timer() {}, }, mounted() {}, async created() { await this.getData(); setTimeout(() => { this.updateSeriesData(); // console.log('done'); }, 3000); /* ; */ // this.timer(); }, beforeDestroy() { // clearInterval(this.timer); }, }; </script> <style scoped> /* #chart { background-color: #18212f; opacity: 1; background-size: 7px 7px; background-image: repeating-linear-gradient( 45deg, #111726 0, #111726 0.7000000000000001px, #18212f 0, #18212f 50% ); } */ </style>
You can specify each stroke width separately by passing array stroke: { curve: 'smooth', lineCap: 'butt', colors: undefined, width: [2,0], },
Integrating Monaco Editor with VueJS
Following the example for integrating the Monaco Editor with Webpack shown here fails when using VueJS. webpack.config.js: // eslint-disable-next-line #typescript-eslint/no-var-requires const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); // eslint-disable-next-line #typescript-eslint/no-var-requires const path = require('path'); module.exports = { entry: './index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'app.js' }, module: { rules: [{ test: /\.css$/, use: ['style-loader', 'css-loader'] }, { test: /\.ttf$/, use: ['file-loader'] }] }, plugins: [ new MonacoWebpackPlugin() ] }; App.vue: <template> <div id="container"></div> </template> <script> import * as monaco from 'monaco-editor' export default { mounted() { monaco.editor.create(document.getElementById('container'), { value: [ 'function x() {', '\tconsole.log("Hello world!");', '}' ].join('\n'), language: 'javascript' }); }, }; </script> <style> #container{ height: 100vh; overflow: hidden; } </style> The editor appears and has syntax highlighting. However, typing causes Unexpected usage errors to be thrown. What step am I missing? Thanks!
Use https://github.com/suren-atoyan/monaco-loader with VueJS.\ import loader from '#monaco-editor/loader'; export default { mounted() { const wrapper = document.getElementById('editor') loader.init().then(monaco => { monaco.editor.create(wrapper, { value: 'const name = "Peter"', }); }); }, }
I run the Fetch hook from the example from the official site
I run the Fetch hook from the example from the official site. "nuxt": "^ 2.14.7" Gives an error message fetch.client.js:109 Error in fetch(): TypeError: Cannot read property '$get' of undefined at _callee$ (index.js?!./node_modules/vue-loader/lib/index.js?!./pages/Video.vue?vue&type=script&lang=js&:74) at tryCatch (runtime.js:63) at Generator.invoke [as _invoke] (runtime.js:293) at Generator.eval [as next] (runtime.js:118) at asyncGeneratorStep (asyncToGenerator.js:5) at _next (asyncToGenerator.js:27) at eval (asyncToGenerator.js:34) at new Promise (<anonymous>) at eval (asyncToGenerator.js:23) at VueComponent.fetch (index.js?!./node_modules/vue-loader/lib/index.js?!./pages/Video.vue?vue&type=script&lang=js&:88) My code <script> export default { layout: 'videoLayout', name: "Video", async fetch () { this.posts = await this.$http.$get('https://jsonplaceholder.typicode.com/posts') .then(posts => posts.slice(0, 20)) console.log(this.posts) }, fetchOnServer: false, data: () => ({ posts: [], videos: [ { color: 'red lighten-2', icon: 'mdi-star', id: 1, title: '22.10.2020 Блага Вість Черкаси', videoId: 'GpgmeaSQ2bc', }, { color: 'purple darken-1', icon: 'mdi-book-variant', id: 2, title: '22.10.2020 Блага Вість Черкаси', videoId: '25yGGiYARbc', }, { color: 'green lighten-1', icon: 'mdi-airballoon', id: 3, title: '22.10.2020 Блага Вість Черкаси', videoId: 'mZbHFWWd6fg', }, { color: 'indigo', icon: 'mdi-buffer', id: 4, title: '22.10.2020 Блага Вість Черкаси', videoId: 'mZbHFWWd6fg', }, ], }), methods: { refresh() { this.$fetch() }, ready (event) { this.player = event.target }, method (url) { this.videoId = this.$youtube.getIdFromURL(url) this.startTime = this.$youtube.getTimeFromURL(url) } } } </script>
I think you may need to install http module first like so: npm install #nuxt/http Then add the following to nuxt.config.js: export default { modules: [ '#nuxt/http', ], http: { // configure any options like // baseURL: "https://jsonplaceholder.typicode.com" } } Then you can make the calls as you were in your code: async fetch () { this.posts = await this.$http.$get('/posts').then(posts => posts.slice(0, 20)) }
Sourcemaps inaccurate (Vue + webpack + sentry)
I'm trying to generate correct sourcemaps for my project written in vue2 so I could later use them in sentry. However right now when I upload them to Sentry, everything seems to be working fine apart from Sentry complaining that it cannot match the location in the source map. Sourcemap Validator also thinks so: http://sourcemaps.io/report/1578938920829_http%3A%2F%2F7ec94d64.ngrok.io%2FSideMenuAnalytics.40e8f1227591b28bea7d.js It looks that sourcemap mappings are off by X characters. Have you seen something like that and could give me a hint how to solve it? Or can someone share webpack config which is producing correct sourcemaps? PS. I've found this: https://github.com/webpack/webpack/issues/8302#issuecomment-521779175 but I'm not sure if it's actually related to my problem. source file (.js): (window.webpackJsonp=window.webpackJsonp||[]).push([[35],{485:function(t,e,i){var n=i(604);"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);(0,i(8).default)("8850203c",n,!0,{})},603:function(t,e,i){"use strict";var n=i(485);i.n(n).a},604:function(t,e,i){(e=i(7)(!1)).push([t.i,".sidebar-menu__item{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;margin-bottom:22px;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.sidebar-menu__tab{width:100%;border-left:4px solid transparent;padding-left:16px;color:#6d7688;display:inline-block;font-weight:500;text-decoration:none;vertical-align:middle;word-break:break-word}.sidebar-menu__tab--active{border-left:4px solid #1593ff;color:#1a2a4a;font-weight:500}.sidebar-menu__activetab{color:#0079e1}#media(max-width: 768px){.sidebar-menu{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}.sidebar-submenu{margin-top:20px;margin-bottom:20px;width:100%;padding-left:20px}.sidebar-submenu .sidebar-menu__item{margin-bottom:1em}",""]),t.exports=e},605:function(t,e,i){var n=i(776);"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);(0,i(8).default)("737a94e4",n,!0,{})},639:function(t,e,i){"use strict";i(22),i(94),i(23);var n={name:"SideMenu",components:{BaseSelect:i(51).r},props:["items","exactlyMatchRoute"],data:function(){return{options:[],menuItem:this.$route.name}},watch:{menuItem:function(t){this.$router.push({name:t}),this.menuItem=t}},methods:{flatten:function(t){var e=this;return t.reduce((function(t,i){return t.push({value:i.name,text:i.i18n}),i.items&&(t=t.concat(e.flatten(i.items))),t}),[])}},created:function(){this.options=this.flatten(this.items)}},a=(i(603),i(1)),o=Object(a.a)(n,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("ul",{staticClass:"sidebar-menu hidden-xs"},t._l(t.items,(function(e){return i("li",{key:e.name},[i("div",{staticClass:"sidebar-menu__item"},[i("router-link",{staticClass:"sidebar-menu__tab",attrs:{"active-class":"sidebar-menu__tab--active",to:{name:e.name},tag:"a",exact:t.exactlyMatchRoute}},[t._v(t._s(e.i18n))]),e.items?i("ul",{staticClass:"sidebar-submenu"},t._l(e.items,(function(e){return i("li",{key:e.name},[i("router-link",{staticClass:"sidebar-menu__tab",attrs:{"active-class":"sidebar-menu__tab--active",to:{name:e.name},tag:"a",exact:!0}},[t._v(t._s(e.i18n))])],1)})),0):t._e()],1)])})),0),i("BaseSelect",{attrs:{classes:"large visible-xs-block",options:t.options},model:{value:t.menuItem,callback:function(e){t.menuItem=e},expression:"menuItem"}})],1)}),[],!1,null,null,null);e.a=o.exports},775:function(t,e,i){"use strict";var n=i(605);i.n(n).a},776:function(t,e,i){(e=i(7)(!1)).push([t.i,".partner-settings__contact{margin-bottom:20px}.partner-settings__title{margin-bottom:20px}.settings__row{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;margin-bottom:20px}.settings__row button:first-child{margin-right:25px}.settings__column{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;width:50%;padding-right:20px}.partner-settings__label{font-weight:500}",""]),t.exports=e},858:function(t,e,i){"use strict";i.r(e);var n={components:{SideMenu:i(639).a},data:function(){return{items:[{name:"general-performance",i18n:this.$t("pPartner general performance")},{name:"campaigns-performance",i18n:this.$t("pPartner campaigns performance")},{i18n:this.$t("jsPartner_analytics overview bookings"),name:"bookings-all",items:[{name:"bookings-all",i18n:this.$t("jsPartner_analytics overview all bookings")},{name:"bookings-conducted",i18n:this.$t("jsPartner_analytics overview conducted bookings")}]}]}}},a=(i(775),i(1)),o=Object(a.a)(n,(function(){var t=this.$createElement;return(this._self._c||t)("SideMenu",{attrs:{items:this.items,exactlyMatchRoute:!1}})}),[],!1,null,null,null);e.default=o.exports}}]); # sourceMappingURL=SideMenuAnalytics.40e8f1227591b28bea7d.js.map sourcemap file (.js.map): {"version":3,"sources":["webpack:///./src/components/SideMenu.vue?b476","webpack:///./src/components/SideMenu.vue?f4a6","webpack:///./src/components/SideMenu.vue?ddfe","webpack:///./src/pages/analytics/SideMenuAnalytics.vue?6589","webpack:///./src/components/SideMenu.vue?6646","webpack:///./src/components/SideMenu.vue?82ff","webpack:///src/components/SideMenu.vue","webpack:///./src/components/SideMenu.vue","webpack:///./src/pages/analytics/SideMenuAnalytics.vue?eb0c","webpack:///./src/pages/analytics/SideMenuAnalytics.vue?0508","webpack:///./src/pages/analytics/SideMenuAnalytics.vue?258b","webpack:///./src/pages/analytics/SideMenuAnalytics.vue?a09f","webpack:///src/pages/analytics/SideMenuAnalytics.vue","webpack:///./src/pages/analytics/SideMenuAnalytics.vue"],"names":["content","module","i","locals","exports","add","default","___CSS_LOADER_API_IMPORT___","push","component","_vm","this","_h","$createElement","_c","_self","staticClass","_l","tab","key","name","attrs","exactlyMatchRoute","_v","_s","i18n","t","_e","options","model","value","callback","$$v","menuItem","expression","items"],"mappings":"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","file":"SideMenuAnalytics.40e8f1227591b28bea7d.js","sourcesContent":["// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../node_modules/css-loader/dist/cjs.js??ref--2-oneOf-0-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--2-oneOf-0-2!../../node_modules/sass-loader/dist/cjs.js??ref--2-oneOf-0-3!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SideMenu.vue?vue&type=style&index=0&lang=scss&\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar add = require(\"!../../node_modules/vue-style-loader/lib/addStylesClient.js\").default\nvar update = add(\"8850203c\", content, true, {});","import mod from \"-!../../node_modules/vue-style-loader/index.js!../../node_modules/css-loader/dist/cjs.js??ref--2-oneOf-0-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--2-oneOf-0-2!../../node_modules/sass-loader/dist/cjs.js??ref--2-oneOf-0-3!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SideMenu.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../node_modules/vue-style-loader/index.js!../../node_modules/css-loader/dist/cjs.js??ref--2-oneOf-0-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--2-oneOf-0-2!../../node_modules/sass-loader/dist/cjs.js??ref--2-oneOf-0-3!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SideMenu.vue?vue&type=style&index=0&lang=scss&\"","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".sidebar-menu__item{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;margin-bottom:22px;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.sidebar-menu__tab{width:100%;border-left:4px solid transparent;padding-left:16px;color:#6d7688;display:inline-block;font-weight:500;text-decoration:none;vertical-align:middle;word-break:break-word}.sidebar-menu__tab--active{border-left:4px solid #1593ff;color:#1a2a4a;font-weight:500}.sidebar-menu__activetab{color:#0079e1}#media(max-width: 768px){.sidebar-menu{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}.sidebar-submenu{margin-top:20px;margin-bottom:20px;width:100%;padding-left:20px}.sidebar-submenu .sidebar-menu__item{margin-bottom:1em}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../../node_modules/css-loader/dist/cjs.js??ref--2-oneOf-0-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--2-oneOf-0-2!../../../node_modules/sass-loader/dist/cjs.js??ref--2-oneOf-0-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SideMenuAnalytics.vue?vue&type=style&index=0&lang=scss&\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar add = require(\"!../../../node_modules/vue-style-loader/lib/addStylesClient.js\").default\nvar update = add(\"737a94e4\", content, true, {});","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('ul',{staticClass:\"sidebar-menu hidden-xs\"},_vm._l((_vm.items),function(tab){return _c('li',{key:tab.name},[_c('div',{staticClass:\"sidebar-menu__item\"},[_c('router-link',{staticClass:\"sidebar-menu__tab\",attrs:{\"active-class\":\"sidebar-menu__tab--active\",\"to\":{ name: tab.name},\"tag\":\"a\",\"exact\":_vm.exactlyMatchRoute}},[_vm._v(_vm._s(tab.i18n))]),(tab.items)?_c('ul',{staticClass:\"sidebar-submenu\"},_vm._l((tab.items),function(t){return _c('li',{key:t.name},[_c('router-link',{staticClass:\"sidebar-menu__tab\",attrs:{\"active-class\":\"sidebar-menu__tab--active\",\"to\":{ name: t.name},\"tag\":\"a\",\"exact\":true}},[_vm._v(_vm._s(t.i18n))])],1)}),0):_vm._e()],1)])}),0),_c('BaseSelect',{attrs:{\"classes\":\"large visible-xs-block\",\"options\":_vm.options},model:{value:(_vm.menuItem),callback:function ($$v) {_vm.menuItem=$$v},expression:\"menuItem\"}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../node_modules/babel-loader/lib/index.js??ref--1!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SideMenu.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js??ref--1!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SideMenu.vue?vue&type=script&lang=js&\"","<template>\n <div>\n <ul class=\"sidebar-menu hidden-xs\">\n <li :key=\"tab.name\" v-for=\"tab in items\">\n <div class=\"sidebar-menu__item\">\n <router-link\n active-class=\"sidebar-menu__tab--active\"\n class=\"sidebar-menu__tab\"\n :to=\"{ name: tab.name}\"\n tag=\"a\"\n :exact=\"exactlyMatchRoute\"\n >{{tab.i18n}}</router-link>\n <!-- second level navigation (this section displays children nested underneath the main element -->\n <ul class=\"sidebar-submenu\" v-if=\"tab.items\">\n <li :key=\"t.name\" v-for=\"t in tab.items\">\n <router-link\n active-class=\"sidebar-menu__tab--active\"\n class=\"sidebar-menu__tab\"\n :to=\"{ name: t.name}\"\n tag=\"a\"\n :exact=\"true\"\n >{{t.i18n}}</router-link>\n </li>\n </ul>\n </div>\n </li>\n </ul>\n <BaseSelect classes=\"large visible-xs-block\" :options=\"options\" v-model=\"menuItem\" />\n </div>\n</template>\n\n<script>\nimport { BaseSelect } from 'Components/base/index';\n\nexport default {\n name: 'SideMenu',\n components: {\n BaseSelect\n },\n props: ['items', 'exactlyMatchRoute'],\n data: function () {\n return {\n options: [],\n menuItem: this.$route.name\n }\n },\n watch: {\n menuItem: function (name) {\n this.$router.push({ name });\n this.menuItem = name;\n }\n },\n methods: {\n flatten: function (array) {\n return array.reduce((acc, value) => {\n acc.push({ value: value.name, text: value.i18n });\n if (value.items) {\n acc = acc.concat(this.flatten(value.items));\n }\n return acc;\n }, []);\n }\n },\n created: function () {\n this.options = this.flatten(this.items)\n }\n};\n</script>\n\n<style lang=\"scss\">\n#import \"~#getyourguide/design-system/colors/colors\";\n#import \"~#getyourguide/design-system/spacing/breakpoints\";\n\n$border-width: 4px;\n$indent: 16px;\n\n.sidebar-menu {\n &__item {\n display: flex;\n align-items: center;\n margin-bottom: 22px;\n flex-direction: column;\n }\n\n &__tab {\n width: 100%;\n border-left: $border-width solid transparent;\n padding-left: $indent;\n color: $ui-slate;\n display: inline-block;\n font-weight: 500;\n text-decoration: none;\n vertical-align: middle;\n word-break: break-word;\n\n &--active {\n border-left: $border-width solid #1593ff;\n color: #1a2a4a;\n font-weight: 500;\n }\n }\n\n &__activetab {\n color: $cta-active;\n }\n\n #media (max-width: $screen-sm-min) {\n flex-direction: row;\n }\n}\n\n.sidebar-submenu {\n margin-top: $border-width + $indent;\n margin-bottom: $border-width + $indent;\n width: 100%;\n padding-left: $border-width + $indent;\n\n // Reset margin in submenu items\n .sidebar-menu__item {\n margin-bottom: 1em;\n }\n}\n</style>\n","import { render, staticRenderFns } from \"./SideMenu.vue?vue&type=template&id=39191e03&\"\nimport script from \"./SideMenu.vue?vue&type=script&lang=js&\"\nexport * from \"./SideMenu.vue?vue&type=script&lang=js&\"\nimport style0 from \"./SideMenu.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import mod from \"-!../../../node_modules/vue-style-loader/index.js!../../../node_modules/css-loader/dist/cjs.js??ref--2-oneOf-0-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--2-oneOf-0-2!../../../node_modules/sass-loader/dist/cjs.js??ref--2-oneOf-0-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SideMenuAnalytics.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/vue-style-loader/index.js!../../../node_modules/css-loader/dist/cjs.js??ref--2-oneOf-0-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--2-oneOf-0-2!../../../node_modules/sass-loader/dist/cjs.js??ref--2-oneOf-0-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SideMenuAnalytics.vue?vue&type=style&index=0&lang=scss&\"","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".partner-settings__contact{margin-bottom:20px}.partner-settings__title{margin-bottom:20px}.settings__row{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;margin-bottom:20px}.settings__row button:first-child{margin-right:25px}.settings__column{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;width:50%;padding-right:20px}.partner-settings__label{font-weight:500}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('SideMenu',{attrs:{\"items\":_vm.items,\"exactlyMatchRoute\":false}})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js??ref--1!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SideMenuAnalytics.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js??ref--1!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SideMenuAnalytics.vue?vue&type=script&lang=js&\"","<template>\n <SideMenu :items=\"items\" :exactlyMatchRoute=\"false\"/>\n</template>\n\n<script>\nimport SideMenu from '../../components/SideMenu.vue';\n\nexport default {\n components: { SideMenu },\n data() {\n return {\n items: [\n { name: 'general-performance', i18n: this.$t('pPartner general performance') },\n { name: 'campaigns-performance', i18n: this.$t('pPartner campaigns performance') },\n {\n i18n: this.$t('jsPartner_analytics overview bookings'),\n name: 'bookings-all',\n items: [\n {name: 'bookings-all', i18n: this.$t('jsPartner_analytics overview all bookings')},\n {name: 'bookings-conducted', i18n: this.$t('jsPartner_analytics overview conducted bookings')},\n ]\n }\n ]\n };\n }\n};\n</script>\n\n<style lang=\"scss\">\n// TODO: title, columns, rows definitions should not\n// live here. All those definitions should be moved into\n// its own components.\n\n.partner-settings__contact {\n margin-bottom: 20px;\n}\n\n.partner-settings__title {\n margin-bottom: 20px;\n}\n\n.settings__row {\n display: flex;\n flex-direction: row;\n margin-bottom: 20px;\n\n button {\n &:first-child {\n margin-right: 25px;\n }\n }\n}\n\n.settings__column {\n display: flex;\n flex-direction: column;\n width: 50%;\n padding-right: 20px;\n}\n\n.partner-settings__label {\n font-weight: 500;\n}\n</style>\n","import { render, staticRenderFns } from \"./SideMenuAnalytics.vue?vue&type=template&id=6982eed3&\"\nimport script from \"./SideMenuAnalytics.vue?vue&type=script&lang=js&\"\nexport * from \"./SideMenuAnalytics.vue?vue&type=script&lang=js&\"\nimport style0 from \"./SideMenuAnalytics.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""} webpack config const path = require("path"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const FriendlyErrorsPlugin = require("friendly-errors-webpack-plugin"); const MomentLocalesPlugin = require("moment-locales-webpack-plugin"); const { VueLoaderPlugin } = require("vue-loader"); const TerserPlugin = require("terser-webpack-plugin"); const state = require("../state"); const { isProd } = state; module.exports = { mode: isProd ? "production" : "development", devtool: isProd ? "source-map" : "cheap-module-eval-source-map", output: { path: path.resolve(__dirname, "../..", "./public/assets/compiled"), publicPath: "/assets/compiled/", filename: "[name].[hash].js" }, resolve: { alias: { Public: path.resolve(__dirname, "../..", "./public"), Components: path.resolve(__dirname, "../..", "./src/components/"), Mixins: path.resolve(__dirname, "../..", "./src/mixins/"), Store: path.resolve(__dirname, "../..", "./src/store/"), Util: path.resolve(__dirname, "../..", "./src/util/"), Pages: path.resolve(__dirname, "../..", "./src/pages/"), Styles: path.resolve(__dirname, "../..", "./src/styles/") } }, module: { noParse: /es6-promise\.js$/, // avoid webpack shimming process // noParse: /^(vue|vue-router|vuex|vuex-router-sync)$/, rules: [ { test: /\.vue$/, loader: "vue-loader", options: { compilerOptions: { preserveWhitespace: false } } }, { test: /\.js$/, loader: "babel-loader", // In order to enable es6 module for SSR render it's necessary to tell babel // that it should process module files. // Reference: https://github.com/nuxt/nuxt.js/issues/3485 // We should only use include || exclude exclude: function(modulePath) { return ( /node_modules/.test(modulePath) && !/node_modules\/#getyourguide\/design-system/.test(modulePath) && !/node_modules\/#getyourguide\/event-logger/.test(modulePath) && !/node_modules\/#sentry\/browser/.test(modulePath) && !/node_modules\/v-tooltip/.test(modulePath) && !/node_modules\/vue-18n/.test(modulePath) ); }, options: { presets: [ [ "#babel/preset-env", { debug: false, useBuiltIns: "usage", corejs: 3, targets: { ie: "11" }, modules: 'auto' // Needed for tree shaking to work. } ] ], plugins: [ "#babel/plugin-syntax-dynamic-import", "#babel/plugin-proposal-object-rest-spread", "#babel/plugin-transform-shorthand-properties" ] } }, { test: /\.scss?$/, oneOf: [ { use: [ "vue-style-loader", { loader: "css-loader", options: { importLoaders: 1, sourceMap: false } }, { loader: "postcss-loader", options: { sourceMap: false, plugins: [ require("autoprefixer")({ grid: true, flexbox: true }) ] } }, { loader: "sass-loader", options: { implementation: require("sass"), sourceMap: false } } ] } ] } ] }, performance: { maxEntrypointSize: 300000, hints: isProd ? "warning" : false }, plugins: [ new VueLoaderPlugin(), new MiniCssExtractPlugin({ filename: "common.[hash].css" }), ...(isProd ? [] : [new FriendlyErrorsPlugin()]), // new BundleAnalyzerPlugin({ // generateStatsFile: true, // openAnalyzer: true // }), // To strip all locales except “en” new MomentLocalesPlugin() ], optimization: { minimizer: isProd ? [ new TerserPlugin({ sourceMap: true }) ] : [] } };
Uncaught Reference Error: Vue is not Defined (Despite Direct Script Included in file)
I have been trying to implement this vue.js template into my vue project and it has been returning "Uncaught ReferenceError: Vue is not defined" despite the direct script set on the first line. <script type="text/javascript" src="https://vuejs.org/js/vue.min.js"</script> <template> <div id="app" class="wrapper"> <fullcalendar class="full-Calendar" :events="events" :editable="true"></fullcalendar> </div> </template> <script> Vue.component('full-calendar', { template: '<div></div>', props: { events: { type: Array, required: true }, editable: { type: Boolean, required: false, default: false }, droppable: { type: Boolean, required: false, default: false } }, data: function() { return { cal: null }; }, ready: function() { var self = this; self.cal = $(self.$el); var args = { lang: 'en', header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, height: "auto", allDaySlot: false, slotEventOverlap: false, timeFormat: 'HH:mm', events: self.events, dayClick: function(date) { self.$dispatch('day::clicked', date); self.cal.fullCalendar('gotoDate', date.start); self.cal.fullCalendar('changeView', 'agendaDay'); }, eventClick: function(event) { self.$dispatch('event::clicked', event); } }; if (self.editable) { args.editable = true; args.eventResize = function(event) { self.$dispatch('event::resized', event); } args.eventDrop = function(event) { self.$dispatch('event::dropped', event); } }; if (self.droppable) { args.droppable = true; args.eventReceive = function(event) { self.$dispatch('event::received', event); } }; this.cal.fullCalendar(args); } }); new Vue({ el: '#app', data: { events: [ { title: 'Event1', start: '2018-08-10 12:30:00', end: '2018-08-10 16:30:00' }, { title: 'Event2', start: '2018-08-07 17:30:00', end: '2018-08-07 21:30:00' } ] }, events: { 'day::clicked': function(date) { console.log(date); } } }); </script> <style> .wrapper { margin: 2rem; } </style> I've also tried adding the direct script to index.html and it leads to "[Vue warn]: Unknown custom element"
you are allowed to use only one <script> tag in the component. since 2 are present it will give preference to the default syntax flow <templete></templete> <script></script> <style></style> check out this https://github.com/vuejs/vue-loader/issues/228 and https://medium.com/#lassiuosukainen/how-to-include-a-script-tag-on-a-vue-component-fe10940af9e8