본문 바로가기

Web/JavaScript79

[Vue3] Getting Started with Vue3 + Electron (with Typescript, TailwindCSS) Let's make a desktop application using Vue3. Create a Project using Vue-CLI $ vue create vue-electron Select "Manually select features" for some options. I picked TypeScript, Router, and Vuex. I will use Vue3. And, I will use ESLint with Prettier. Lastly, I will use dedicated config files for easier management. $ cd vue-electron Now, we have our project. Adding Electron Now, let's add Electron t.. 2021. 6. 28.
[Vue3] Vuex Usage Vuex is a library that helps create centralized repositories to manage data and state. Create a Project Let's create a project for vuex. 2021.06.02 - [Web/JavaScript] - [Vue3] Getting Started with Vue3 + TypeScript + TailwindCSS Installing Vuex $ vue add vuex You just type this command if you want to use vuex. You can also set it in the create a project stage. Creating Store The store is a react.. 2021. 6. 26.
[Vue3] Mixins Mixin is a method of implementing functions separately and combining mixin files into components whenever necessary. Create a Project 2021.06.02 - [Web/JavaScript] - [Vue3] Getting Started with Vue3 + TypeScript + TailwindCSS Let's create a project to start to learn Mixin. Create Mixins mixins/mixin.ts export default { methods: { $callMixin(name: string): string { return `Hello, ${name}`; }, }, .. 2021. 6. 26.
[Vue3] Composition API Composition API is a function-based API added to Vue3. Let's take a look at this what is this. Create a Project 2021.06.02 - [Web/JavaScript] - [Vue3] Getting Started with Vue3 + TypeScript + TailwindCSS First of all, create a project for testing our example. Traditional Methods Let's create an adder component in the traditional way. components/composition_api.vue Traditional Method + = {{ resul.. 2021. 6. 25.
[vue3] Plugins Vue3 has a plugin feature. Let's learn about this. Create a Project Create a project for a plugin example. 2021.06.02 - [Web/JavaScript] - [Vue3] Getting Started with Vue3 + TypeScript + TailwindCSS Creating Plugins Let's create a plugin file. plugins/vending.ts import { Plugin } from "vue"; export const vendingPlugin: Plugin = { install(app, options?) { app.config.globalProperties.$pick = (key:.. 2021. 6. 25.
[Vue3] Custom Directives Vue3 allows that user defines their own directives. Create a Project Let's create a project first. 2021.06.02 - [Web/JavaScript] - [Vue3] Getting Started with Vue3 + TypeScript + TailwindCSS Create Own Directives in Global Creating a global custom directive uses directive method. main.ts const app = createApp(App) app.directive("focus", { mounted: (el) => el.focus(), }); app.mount("#app"); We cr.. 2021. 6. 24.
[Vue3] Send Data from Ancestor Component using Provide and Inject We can send data from a parent component to a child component using props. However, the deeper the hierarchy, the more redundant delivery, the more complexity of the code. In this situation, you can simply use provide and inject. Just use provide where you want to send data and use inject where you want to use the data. Create a Project Please create a project to test this feature. 2021.06.02 - .. 2021. 6. 20.
[Vue3] Slot (v-slot) Usage We can define the common framework of the template using slot to make the code neatly. Create a Project Let's create a project first. 2021.06.02 - [Web/JavaScript] - [Vue3] Getting Started with Vue3 + TypeScript + TailwindCSS Create a Common Layout Now, let's define the common layout. components/slot_layout.vue I created three slots and gave them a name. The unnamed slot has default as the defau.. 2021. 6. 20.
[Vue3] Component Usage In this posting, we'll learn about component usage on Vue. Most projects don't consist of a single file. So, we usually create several components and consist of these components in a project. Create a Project First of all, let's create a simple project for testing. 2021.06.02 - [Web/JavaScript] - [Vue] Getting Started with Vue3 + TypeScript + TailwindCSS Basic Usage This is the default folder st.. 2021. 6. 20.
[Vue3] Vue-Router Usage Most of the projects have routers. It is like a navigator of the application. In this posting, we will learn about this feature on Vue3. Create a Project 2021.06.02 - [Web/JavaScript] - [Vue3] Getting Started with Vue3 + TypeScript + TailwindCSS Create a project to test. And, add the router feature to the project. $ vue add router ※ You can also create a project with a router through Vue-CLI. No.. 2021. 6. 18.
[Vue3] Lifecycle In this posting, we will learn about the lifecycle of Vue. If you learn about the lifecycle, it can be helpful in development. Create a Project Let's create a project to test the lifecycle. 2021.06.02 - [Web/JavaScript] - [Vue3] Getting Started with Vue3 + TypeScript + TailwindCSS Create a Lifecycle Component Exchange the HelloWorld component to Lifecycle component. components/Lifecycle.vue Life.. 2021. 6. 16.
[Vue3] Computed Property and Watcher The computed property allows to dynamically computed value and the watcher allows monitoring the values. Let's figure out it with simple examples. Create a Project Let's create a project first. 2021.06.02 - [Web/JavaScript] - [Vue] Getting Started with Vue3 + TypeScript + TailwindCSS Computed Properties Computed Property: Calculate Price Apple: ₩500 Total Price: ₩{{ totalPrice }} This example ha.. 2021. 6. 12.