Answer the question
In order to leave comments, you need to log in
How to connect Vue to a project inside TypeScript?
I connected Vue to the project inside the JavaScript file and everything worked, but when I renamed index.js to index.ts, everything stopped working. Webpack for working with ts is configured and processes other ts scripts.
// Vue.js
window.Vue = require('vue')
import store from './vue/store/index'
// Vue components (for use in html)
Vue.component('example-component', require('./vue/components/Example.vue').default)
// Vue init
const app = new Vue({
store,
el: '#app'
})
window.Vue = require('vue')
Answer the question
In order to leave comments, you need to log in
Maybe it's worth importing?
Instead of https://vuejs.org/v2/guide/typescript.html
import Vue from 'vue';
window.Vue = require('vue')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question