2

I'm trying to set up a Vue TS based project. You can view a structure of it inside this repo:

https://github.com/AndrewBogdanovTSS/typed-vue-test

I'm using latest versions of all dependencies that are required to render TS inside .vue files. Once I'm running a project my TS constructor seems to be running without any issues (I see console statements are working normally) but the problem is that template data isn't getting to the browser's DOM. Moreover, the default div with id app is getting removed so the only thing that is left inside of my DOM is a reference to build.js file. I don't have any errors occurring on the first run, but once I do any change inside of the .vue file I'm getting:

TypeError: Cannot read property 'extend' of undefined
2
  • Try one of boilerplates from the vue-awesome. Commented Dec 2, 2017 at 11:33
  • Yes, I've tried other templates and they are working. But I want to understand what is particularly wrong with mine Commented Dec 2, 2017 at 11:42

1 Answer 1

3

I've figured out what was wrong with my code, I forgot to use @Component decorator in front of my ts class inside App.vue file. Without it, TS code has been executing but it wasn't connected to the Vue instance, that's why nothing was displaying on the screen. I went and created a new repo that I plan to support as my base template for Vue-TS type projects. https://github.com/AndrewBogdanovTSS/typed-vue

feel free to suggest improvements/ideas

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.