Introduction to Vue3 - Building a Stop Watch Timer (with Composition API)

  Рет қаралды 5,337

Web Dev Cody

Web Dev Cody

Күн бұрын

🤖 SaaS I'm Building: www.icongenera...
💬 Discord: / discord
🔔 Newsletter: newsletter.web...
📁 GitHub: github.com/web...
📺 Twitch: / webdevcody
🤖 Website: webdevcody.com
🐦 Twitter: / webdevcody

Пікірлер: 39
@darialyphia
@darialyphia Жыл бұрын
Also if you want to conditionally render multiple elements, but don't want to wrap them in a div, you can wrap them in a and add the v-if to it ! (this also works with v-for). It's really helpful
@WebDevCody
@WebDevCody Жыл бұрын
Nice so it’s like fragments kind of
@gearmaxim
@gearmaxim Жыл бұрын
I really enjoy working with vue, thanks for the video!
@oumardicko5593
@oumardicko5593 Жыл бұрын
You can use objects with ref, when on property of you object changes, it will re-render. Unlike in react you don't need to create a new object using restructuring
@karlstenator
@karlstenator Жыл бұрын
This is perfect timing! I'm both learning Vue 3 and building a hobby timing project for my running club. Most excellent. 🏆
@hsider
@hsider Жыл бұрын
Pretty good demo of VueJs 👌 I would disable the buttons instead of hiding them. I've used Vuejs since it came out and still using it for most of my projects, the separation of JS and HTML made sense to me since I designed a lot of web pages in HTML and CSS so Vuejs makes it easy to add interactivity to those HTML templates without headache.
@chrisbolson
@chrisbolson Жыл бұрын
I have recently been learning React and Vue (or Anglular) was next on my list. This is the first video I have watched regarding View and, having seen your brief intro, I now I wish I had started with Fue before React - it looks so much simpler and closer to Vanilla JavaScript. I look forward to seeing more. Thanks!!
@WebDevCody
@WebDevCody Жыл бұрын
It is much simpler in some aspects.
@tobychidi
@tobychidi Жыл бұрын
Green light looks cool
@marcoss4563
@marcoss4563 Жыл бұрын
nice! ty!
@kylebaker8548
@kylebaker8548 Жыл бұрын
first lol keep up the great content cody!
@SeibertSwirl
@SeibertSwirl Жыл бұрын
Lmaoooooooo ughhhh I woke up late!!! I will be first once again
@agcodes
@agcodes Жыл бұрын
what I learnt, green light = vue blue = react 😂
@shakapaker
@shakapaker Жыл бұрын
pnpm v8 🥰
@hanes2
@hanes2 Жыл бұрын
I'm using vue which is nice, trying out Nuxt.
@bughlinjo9372
@bughlinjo9372 Жыл бұрын
hello cody i just started learning react and i have a question. i have header and nav in seperate files and i want to import increment function in header. i can,t seem to do it. can you help me?
@WebDevCody
@WebDevCody Жыл бұрын
Where is your increment function declared? You probably need to put the increment function in a separate file and export it. Then any vue components could use it. Your increment file would also have a count ref which other components could import
@bughlinjo9372
@bughlinjo9372 Жыл бұрын
@@WebDevCody i use react/vite and i declared increment function with useState in a seperate file and exported it than i used it onclick={} on button and than i need to use {count} in a seperate file for number to go up but when i use {count } it says word cannot be found.
@rajusharma823
@rajusharma823 Жыл бұрын
pass it as props. join the discord people may help you there. :)
@bughlinjo9372
@bughlinjo9372 Жыл бұрын
@@rajusharma823 oh than i have to learn that thanks
@rookie549
@rookie549 Жыл бұрын
@@bughlinjo9372 React Context
@damjandjordjevic1994
@damjandjordjevic1994 Жыл бұрын
What would happen if state wasn't a ref? I get confused when I should use a ref and when I shouldn't...
@WebDevCody
@WebDevCody Жыл бұрын
with composition api, you use ref when you need dynamic state. If you just have a constant you could just declare a normal const variable at the top of the script
@OlegSim-b3g
@OlegSim-b3g Жыл бұрын
vue content 👍
@oumardicko5593
@oumardicko5593 Жыл бұрын
You could have used a computed value that will update the text depending on the state. And on single function which will do an action depending on the state too 🤔. We would have violated the single responsibility principle but it works
@WebDevCody
@WebDevCody Жыл бұрын
Oh so you mean use a watch that listens for the timer state and run different code depending on the new value? Yeah a computed would help cache the timer output, but with this small scale of app I don’t think it would really make a difference
@oumardicko5593
@oumardicko5593 Жыл бұрын
@@WebDevCody you have quite a few ways to do this
@piotrm98
@piotrm98 Жыл бұрын
I have a question, I did same app in React yesterday and i have a problem that when you switch to a different tab in your browser then your stopwatch stops. I read that its an optimization thing that browser does. Do you know how to get around this?
@WebDevCody
@WebDevCody Жыл бұрын
You’d need to store a timestamp when you click start, then calculate the diff between the start and now, then display the diff formatted
@gregconen
@gregconen Жыл бұрын
Really, you should do that anyway; if you just use setInterval, you can lose time even in an active tab if the browser is busy with something else. But the timing mechanism is not the point of the video.
@adrianfr05
@adrianfr05 Жыл бұрын
Next svelte 👀
@mrkanata7696
@mrkanata7696 Жыл бұрын
good video. What is your vscode theme ?
@WebDevCody
@WebDevCody Жыл бұрын
bearded theme stained blue
@mrkanata7696
@mrkanata7696 Жыл бұрын
@@WebDevCody thx bro :)
@kakun7238
@kakun7238 Жыл бұрын
what about nuxt
@WebDevCody
@WebDevCody Жыл бұрын
yeah I'll probably use that with v3 app soon as well
@lebroncarmelo1523
@lebroncarmelo1523 Жыл бұрын
In my opinion vue has gradually declined
@WebDevCody
@WebDevCody Жыл бұрын
How so
@darialyphia
@darialyphia Жыл бұрын
npm i @vueuse/core import { useIntervalFn } from '@vueuse/core' vueuse ie too goated 😄
Here's an overview of all my revenue generating side projects
19:38
#35 Options vs Composition, часть 1 - Vue.js: концепции
17:38
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Паша Осадчий
Рет қаралды 5 МЛН
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 53 МЛН
Stop Using .value with ref In Vue 3! Reactivity Transformed Explained!
14:22
I got 10x faster performance from this simple Node.js refactor
13:13
The Pinia Crash Course
34:40
Laith Academy
Рет қаралды 16 М.
What are my thoughts on Vue3
25:21
Web Dev Cody
Рет қаралды 11 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
Ranking The Most Popular Javascript Frameworks 2023
24:43
developedbyed
Рет қаралды 156 М.
Vue 3 Composition API Introduction [FULL TUTORIAL]
23:46
Academind
Рет қаралды 174 М.
JavaScript Project: Countdown Timer with Progress Indicator
22:58