This is the code for the crash course on YouTube
# Install dependencies
npm install
# Serve on localhost:8080
npm run serve
# Build for production
npm run build
Vue crash course application
This is the code for the crash course on YouTube
# Install dependencies
npm install
# Serve on localhost:8080
npm run serve
# Build for production
npm run build
For some reasons my component templates are not getting loaded.
Module Warning (from ./node_modules/eslint-loader/index.js): error: 'Todos' is defined but never used (no-unused-vars) at src/App.vue:8:8: 6 | 7 | <script> > 8 | import Todos from './components/Todos'; | ^ 9 | 10 | export default { 11 | name: 'app', 1 error found.
I am not sure why is this problem. I guess vue-template-loader is not working.. How do I get rid off this?
Kindly help me in this.
FYI: I am using Linux Mint 19 Tara
Duplicate keys detected: '201'. This may cause an update error.
found in
---> <Todos> at src/components/Todos.vue
<Home> at src/views/Home.vue
<App> at src/App.vue
<Root>
Hi everyone. Thank you very much Traversy for the course!
It is a quick and simple introduction to Vuejs and serves as a strong foundation for future learning.
I am facing a slight problem with jsonplaceholder however.
I constantly get cors errors and been bogging the head to fix it.
If anyone of the community could have a look at it I would very much appreciate it.
I'm having this error even tho i did every step correct
./src/App.vue Module Error (from ./node_modules/eslint-loader/index.js): error: 'res' is defined but never used (no-unused-vars) at src/App.vue:30:15: 28 | axios 29 | .delete(
https://jsonplaceholder.typicode.com/todos/${id}`)
30 | .then(res => (this.todos = this.todos.filter(todo => todo.id !== id)))
| ^
31 | .catch(err => console.log(err));
32 | },
33 | addTodo(newTodo) {`
After creating the app, I installed the vue router, then installed axios, then copied in these source files. I got an error in the home.vue file at line 27. It said that res
is not used. In a comment by Michael Gtz at around 4/30/2020, he said to change the code to look like this:
deleteTodo(id) {
axios.delete(`https://jsonplaceholder.typicode.com/todos/${id}`)
.then(this.todos = this.todos.filter(todo => todo.id !== id))
.catch(err => console.log(err));
and it resolved the error.
If you're new to Vue and are needing to remove /#/
from the URL I've found this can be done in router.js by adding the below to the Router
:
src/router.js:
mode: 'history',
hash: false,
versions:
"dependencies": {
"axios": "^0.20.0",
"core-js": "^3.6.5",
"uuid": "^8.3.1",
"vue": "^2.6.11",
"vue-router": "^3.4.6"
},
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.