Vue JS – Comprehensive Course from Scratch | Result University

Posted by


Vue JS (often pronounced as "view") is a progressive JavaScript framework used to build user interfaces and single-page applications. If you’re looking to learn Vue JS from scratch, the course "Vue JS – Полный курс c нуля" from Result University is a great place to start. In this detailed tutorial, we will cover the key concepts and features of Vue JS that are taught in this course.

  1. Introduction to Vue JS:

    • Vue JS is a lightweight framework that is easy to incorporate into existing projects. It is designed to be incrementally adoptable, so you can start using it in small parts of your project and gradually expand its usage.
    • Vue JS is well-known for its simplicity and ease of use. It focuses on the View layer of the application and allows developers to create interactive and dynamic user interfaces with minimal effort.
    • The course "Vue JS – Полный курс c нуля" from Result University is designed for beginners who have little to no experience with Vue JS. It covers all the foundational concepts and features required to build modern web applications.
  2. Setting up the development environment:

    • Before diving into Vue JS, you need to set up your development environment. Install Node.js and npm (Node Package Manager) on your computer to manage dependencies and run scripts. You can download Node.js from the official website (https://nodejs.org).
    • Once Node.js is installed, you can use npm to install Vue CLI (Command Line Interface) globally on your computer. Vue CLI is a command-line tool that helps you create, manage, and build Vue JS projects. Run the following command in the terminal to install Vue CLI:
      npm install -g @vue/cli
    • After installing Vue CLI, you can create a new Vue JS project by running the following command:
      vue create my-vue-app
    • Replace "my-vue-app" with the name of your project. Vue CLI will guide you through the project setup process and create a new Vue JS project in the specified directory.
  3. Understanding the Vue instance:

    • In Vue JS, everything revolves around the Vue instance. The Vue instance is created using the new Vue() constructor and serves as the root of your Vue application.
    • You can define data properties, methods, computed properties, and lifecycle hooks in the Vue instance. Data properties store the reactive data that drives the user interface, while methods perform actions based on user interactions.
    • Here is an example of a simple Vue instance:
      new Vue({
      el: '#app',
      data: {
       message: 'Hello, Vue!'
      },
      methods: {
       greet() {
         alert(this.message);
       }
      }
      });
    • In this example, the Vue instance is mounted on the element with the id of "app." The data property stores a message that is displayed in the user interface, and the greet method shows an alert with the message when called.
  4. Templating with Vue JS:

    • Vue JS uses a simple and concise templating syntax to bind data to the DOM and create dynamic content. You can use directives like {{ }} for text interpolation, v-bind for attribute binding, v-if for conditional rendering, and v-for for list rendering.
    • Here is an example of template interpolation in Vue JS:
      <div id="app">
      <p>{{ message }}</p>
      </div>
      new Vue({
      el: '#app',
      data: {
       message: 'Hello, Vue!'
      }
      });
    • In this example, the message "Hello, Vue!" is bound to the p element using text interpolation. Any changes to the message data property will automatically update the displayed text.
  5. Handling user input with Vue JS:

    • Vue JS provides two-way data binding, which means that changes to form inputs are automatically reflected in the associated data properties and vice versa. You can use directives like v-model to create two-way binding for form elements.
    • Here is an example of two-way data binding with an input element in Vue JS:
      <div id="app">
      <input type="text" v-model="message">
      <p>{{ message }}</p>
      </div>
      new Vue({
      el: '#app',
      data: {
       message: 'Hello, Vue!'
      }
      });
    • In this example, the input element is bound to the message data property using the v-model directive. Any changes made to the input will update the message property and reflect in the displayed text.
  6. Computed properties and watchers:

    • Computed properties in Vue JS are used to derive values based on the existing data properties. They are cached and only re-evaluated when their dependencies change, improving performance.
    • Watchers in Vue JS allow you to perform asynchronous or expensive operations when specific data properties change. They are useful for handling side effects or reacting to data changes.
    • Here is an example of using computed properties and watchers in Vue JS:
      <div id="app">
      <input type="number" v-model="quantity">
      <p>Total: {{ total }}</p>
      </div>
      new Vue({
      el: '#app',
      data: {
       price: 10,
       quantity: 0
      },
      computed: {
       total() {
         return this.price * this.quantity;
       }
      },
      watch: {
       quantity(newVal, oldVal) {
         console.log(`Quantity changed from ${oldVal} to ${newVal}`);
       }
      }
      });
    • In this example, the total computed property calculates the total price based on the input quantity and price. The quantity watcher logs a message when the quantity changes.
  7. Component-based architecture in Vue JS:

    • Vue JS supports component-based architecture, allowing you to create reusable and modular UI components. Components encapsulate their own data, methods, and lifecycle hooks, making them easy to manage and reuse.
    • You can register components globally or locally within a Vue instance. Components can communicate with each other using props for parent-child communication and events for child-parent communication.
    • Here is an example of creating and using a basic Vue component:

      <!-- ChildComponent.vue -->
      <template>
      <button @click="increment">{{ count }}</button>
      </template>
      <script>
      export default {
      data() {
       return {
         count: 0
       };
      },
      methods: {
       increment() {
         this.count++;
         this.$emit('incremented', this.count);
       }
      }
      };
      </script>
      <div id="app">
      <child-component @incremented="updateCount"></child-component>
      <p>Total count: {{ totalCount }}</p>
      </div>
      import Vue from 'vue';
      import ChildComponent from './ChildComponent.vue';
      
      new Vue({
      el: '#app',
      data: {
       totalCount: 0
      },
      methods: {
       updateCount(count) {
         this.totalCount += count;
       }
      },
      components: {
       ChildComponent
      }
      });
    • In this example, the ChildComponent emits an event when the button is clicked, and the parent component updates the total count based on the emitted data.
  8. Routing in Vue JS:

    • Vue JS provides a built-in router that allows you to create single-page applications with multiple views and navigations. You can define routes, nested routes, and route parameters using the Vue Router library.
    • To set up routing in Vue JS, you need to install Vue Router and configure the routes in the main Vue instance. You can use router-link for navigation and router-view for displaying the current route component.
    • Here is an example of setting up routing in Vue JS:

      import Vue from 'vue';
      import VueRouter from 'vue-router';
      
      Vue.use(VueRouter);
      
      const Home = { template: '<div>Home</div>' };
      const About = { template: '<div>About</div>' };
      
      const routes = [
      { path: '/', component: Home },
      { path: '/about', component: About }
      ];
      
      const router = new VueRouter({
      routes
      });
      
      new Vue({
      el: '#app',
      router,
      template: `
       <div>
         <router-link to="/">Home</router-link>
         <router-link to="/about">About</router-link>
         <router-view></router-view>
       </div>
      `
      });
    • In this example, the Vue Router is initialized with two routes for the home and about pages. The router links define navigation between the routes, and the router view displays the current route component.
  9. State management with Vuex:

    • Vuex is a state management library for Vue JS that helps you manage global application state in a predictable and centralized way. It consists of a store, state, mutations, actions, and getters.
    • To use Vuex in your Vue JS project, you need to install the Vuex library and set up a store with modules for managing different parts of the application state. You can commit mutations to update the state and dispatch actions to perform asynchronous operations.
    • Here is an example of setting up a Vuex store in Vue JS:

      import Vue from 'vue';
      import Vuex from 'vuex';
      
      Vue.use(Vuex);
      
      const store = new Vuex.Store({
      state: {
       count: 0
      },
      mutations: {
       increment(state) {
         state.count++;
       }
      },
      actions: {
       incrementAsync({ commit }) {
         setTimeout(() => {
           commit('increment');
         }, 1000);
       }
      }
      });
      
      new Vue({
      el: '#app',
      store,
      template: `
       <div>
         <p>{{ $store.state.count }}</p>
         <button @click="$store.commit('increment')">Increment</button>
         <button @click="$store.dispatch('incrementAsync')">Increment Async</button>
       </div>
      `
      });
    • In this example, the Vuex store manages the count state with a mutation to increment the count synchronously and an action to increment the count asynchronously after a delay.
  10. Conclusion:
    • Vue JS is a powerful and versatile framework for building interactive and dynamic user interfaces. The course "Vue JS – Полный курс c нуля" from Result University covers all the essential concepts and features of Vue JS, from setting up the development environment to advanced topics like routing and state management.
    • By following this tutorial and completing the course, you will gain a solid understanding of Vue JS and be able to create modern web applications with ease. Start your Vue JS journey today and unlock the full potential of this popular JavaScript framework. Happy coding!
0 0 votes
Article Rating
47 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@VladilenMinin
1 month ago

Теперь любой сам может оценить качество этого курса и сделать для себя вывод: полезный он или нет. Всем приятного обучения!

Начать бесплатно профессию + диагностика в Result: https://bit.ly/3YjEXxc
Полный Roadmap по Frontend: https://bit.ly/3Yjvzd8

Исходники в моем телеграм канале: https://t.me/js_by_vladilen

Поддержать + вступить в закрытый клуб: https://t.me/NextgenSocialBot

@dront111
1 month ago

курс безбожно устарел, еще б 10ти летней давности выложил. сейчас только vue 3 со script setup и pinia для стора, в идеале на ts.
не тратьте время, полно других актуальных и нормальных материалов для обучения.

@Rendar2slcz
1 month ago

4:52:00 Не срабатывает isOpen, т.к Vue говорит, что в дочерний компонент приходит свойство, которое изменять нельзя. Т.е При нажатии на кнопку @click="isOpen = !isOpen" Не срабатывает высвечивание текста. Пытался найти ответ в интернету, но что то слишком сложно для моего уровня. Можете пожалуйста обьяснить почему это произошло и как связать значения из дочернего компонента в родительский без костылей.
Ну или как написано ниже в комментариях, нет смысла изучать старое, потому что все ответы в интернете направлены на новый синтаксис.

@tortik_0162
1 month ago

тк я немного не понял, это один из видосов (блоков) и дальше будет ещё 3 таких видоса или это все 4 блока сразу? Тогда не понял зачем говорить про 4 блока.
PS, только начало щас смотрю

@mythl.l.l9397
1 month ago

Сегодня начал смотреть next.js и вообще мне нравится реакт, но тут курс по вью на 18 часов….я теперь разрываюсь что учить

@qazarddeunicorn
1 month ago

Спасибо Дорогой! Такие как ты, двигаешь нашу отрасль вперед

@user-ut4jg2sw2l
1 month ago

Отлично, 👍 🎉 не в курсе шо к чему, но прям в тему. Из всех фронтовых фреймов мне только Vue и Angular остались ))

@oldiBerezkoo
1 month ago

Я от этого курса узнал о тебе и с тех пор смотрю тебя ))

@alexey9337
1 month ago

Хи… не могу досмотреть – ютюб не грузит, не могу скачать, большой файл (((

@yanballas3055
1 month ago

Никогда особо не следил за Владиленом, но слышал об этой ситуации. Поступок максимально мужской.

@vitaly-dv1cr
1 month ago

Спасибо за такое полезное видео. Было бы неплохо побить на таймкоды.

@alexey9337
1 month ago

Начало 35:38

@ulugbekalimov5958
1 month ago

Когда будет курс Ангулар 17 + ??

@corvus278
1 month ago

А на сколько курс актуален?
Всё таки давно записан

@olegsl73
1 month ago

Респект и уважуха! Спасибо!

@ligh7fun
1 month ago

Возможно совпадение, но неделю назад пытался найти что-то стоящее в ру сегменте и ничего не нашлось, начал искать забугорное и тут такое. Спасибо 🙂

@nh42so42
1 month ago

Я на реакте год пишу, хочу перекатиться во вью, скажите, я в конце курса смогу несложную CRMку с react на vue переписать? этой информации будет достаточно?

@homersimpson7487
1 month ago

выложите пожалуйста курс по биткоину

@nitral911
1 month ago

Ну судя по тому видео АйтиБороды, что послужило, как я понимаю, поводом для публикации данного видео, то критика была не на пустом месте и не для того что бы просто покритиковать из каких-то корыстных/завистливых побуждений, а для того что бы держать планку обучающих материалов во Vue комьюнити. И говорилось о том, что были некоторые неточности в материалах, а не критиковали курс как таковой…

@VitalyLiber
1 month ago

Владилен, ну ты монстр