728x90

Option API

export default{
  data(){
    return{
    
    }
  },
  methods:{
  
  },
  computed:{
  
  },
  mounted(){
  
  }
}
  • 같은 종류의 일을 한다고 하더라고 코드가 data, mothods, computed, mounted에 떨어져 있을 수 있다. 즉, 응집성이 떨어진다

Composition API

export default{
  setup(){
    //data
    
    //methods
    
    //computed
    
    //lifecycle hooks
  }
}
  • 비즈니스 로직과 데이터를 setup() 이라는 함수에서 통합 관리할 수 있다. 응집성이 올라간다.

setup

  • 복잡한 로직에서 사용. react의 custom hook와 비슷하다.
<template>
<div  class="home">
  home
  <p ref="p"> My name is {{name}} and age is {{age}} </p>
  <button @click="handleClick">click me</button>
</div>

</template>

<script>
import {ref} from 'vue';

export default{
  setup(){
    console.log('set up');
  
    const p = ref(null);
  
    let name = 'mario';
    let age = 30;
  
    const handleClick = () =>{
      p.value.classList.add('test');
      p.value.textContext = 'hello';
    }
  
    return{
      name,
      age,
      p,
      handleClick,
    }
  }
}
</script>
  • created() 보다 먼저 실행된다
  • 반환 데이터 reactive하게 변경하는 방법
    1. ref 사용. 변수를 ref를 이용하여 선언하면 reactive 해진다. 해당 변수값 참조시 setup() 내에서는 .value를 붙이고 바깥에서는 해당 변수명을 그대로 참조하면된다.
      • <template>
        <div  class="home">
          home
          <p ref="p"> My name is {{name}} and age is {{age}} </p>
          <button @click="handleClick">click me</button>
        </div>
        
        </template>
        
        <script>
        import {ref} from 'vue';
        
        export default{
          setup(){
          
            let name = ref('mario'); // ref 내부 값은 초기값을 의미한다
            let age = ref(30);
          
            const handleClick = () =>{
              name.value = 'luigi';
              age.value = 35;
            }
          
            return{
              name,
              age,
              handleClick,
            }
          }
        }
        </script>
    2. reactive사용. 변수를 reactive를 이용하여 선언하면 reactive해진다. ref와 사용법은 유사하지만 setup()내에서 .value를 이용하지 않고도 변수값을 참조할 수 있다는점, primitive type이 초기값으로 주어져서는 안된다는 점이 유일하게 다르다
      • <template>
        <div  class="home">
          home
          <p ref="p"> My name is {{ninja.name}} and age is {{ninja.age}} </p>
          <button @click="handleClick">click me</button>
        </div>
        
        </template>
        
        <script>
        import {reactive} from 'vue';
        
        export default{
          setup(){
          
            const ninja = reactive({name:'mario',age:30});
          
            const updateNinja = () =>{
              ninjaOne.age=40;
            }
          
            return{
              ninja,
              updateNinja,
            }
          }
        }
        </script>
  • 내부에서 computed를 사용할 수 있다.
    • <template>
      <div  class="home">
        <input type="text" v-model=search/>
        <ul v-for="name in names" :key="name">
          <li>{{name}}</li>
        </ul>
      </div>
      
      </template>
      
      <script>
      import {computed,ref} from 'vue';
      
      export default{
        setup(){
          
          const search = ref('');
          const names = ['mario','yoshi','luigi','toad','bowser','koopa','peach'];
          
          const filteredNames = computed(()=>{
            return names.filter((name)=>name.includes(search.value));
          })
          
          return{
            search,
            names:filteredNames
          }
        }
      }
      </script>
  • watch, watchEffect를 사용할 수 있다.
    • watch: Vue2에서 일반적으로 사용하던 watch와 동일. observe할 value를 등록후 해당 값이 변경되면 callback함수 실행
    • watchEffect: callback 함수 내부 변수의 dependency를 찾아 해당 dependency 변수값이 변경되면 callback함수가 자동으로 실행된다. watchEffect 의 반환값을 대입 받은 변수를 실행하면 watchEffect는 destroy된다.
    • // 다음은 search 값이 변경되면 자동으로 watch, watchEffect의 callback 함수를 실행하게 만든 코드이다.
      // handleClick 실행시 watch와 watchEffect는 메모리를 반환한다.
      <script>
      import {watch,watchEffect,ref} from 'vue';
      
      export default{
        setup(){
          
          const search = ref('');
          const names = ['mario','yoshi','luigi','toad','bowser','koopa','peach'];
          
          const stopWatch = watch(search,()=>{
            console.log('watch function ran');
          })
          
          const stopEffect = watchEffect(()=>{
            console.log('watchEffect function ran',search.value);
          })
          
          const handleClick = ()=>{
            stopWatch();
            stopEffect();
          }
          
          return{
            search,
          }
        }
      }
      </script>
  • props를 받을 수 있다.
    • // PostList.vue
      // posts props가 넘어온 상황
      <script>
      export default{
        props: ["posts"], //props를 선언해줘야한다.
        setup(props){
          console.log(props.posts)
        }
      }
      </script>
  • vue lifecycle을 이용할 수 있다. setup 밖의 동일한 lifecycle보다 먼저 실행된다.
    • <script>
      export default{
        setup(props){
          onMounted(()=>console.log("component Mounted"));
          onUnMounted(()=>console.log("component UnMounted"));
          onUpdated(()=>console.log("component Updated"));
        }
      }
      </script>

componentAPI에서 data fetch

setup()에 async를 선언않고 setup() 내부에 async function을 생성해 이를 호출한다.

<template>
  <div class="Home">
    <div v-if="error">{{error}}</div>
    <div v-if="posts.length">
      <PostList :posts="posts"/>
    </div>
    <div v-else>
      Loading...
    </div>
  </div>
</template>

<script>
import {ref} from 'vue'
export default{
  setup(){
    const posts= ref([]);
    const error = ref(null);
    
    const load = async() =>{
      try{
        let data = await fetch('asdf');
        if(!data.ok){
          throw new Error('no data available'
        }
        posts.value = await data.json(); 
      }catch(e){
        error.value = e.message;
        console.log(error.value);
      }
    }
  }
}
</script>

Reusable Composables

여러 컴포넌트에서 같은 로직의 setup()을 사용할 경우 코드를 반복해서 사용하는것은 비효율적이다.

다른 파일로 떼어놓고 필요할때마다 호출하여 사용할 수 있다.

//composables/getPosts.js
import {ref} from 'vue';

const getPosts = () =>{
  const posts = ref([]);
  const error = ref(null);
  
  const load = async()=>{
    try{
      let data = fetch('asdf')
      if(!data.ok){
        throw new Error('no data available');
      }
      posts.value = await data.json();
    }catch(e){
      error.value = e.message;
      console.error(error.value);
    }
  }
  //load(); //넣지않는다
  
  return {posts,error,load}
}

export default getPosts;
//Home.vue
<script>
export default{
  import getPosts from '../composables/getPosts'
  setup(){
    const {posts,error,load} = getPosts(); // 처음에 posts와 error은 비어있는 상태. 뒤에 load가 호출되면 값이 채워진다.
    load() // getPosts에 집어넣지 않는다.
    return {posts,error}
  }
}
</script>

Vue3 + Typescript 설정 방법

npm install -g @vue/cli

 

vue --version 4.5.8

 

vue create vue-3-and-typescript

 

Babel

Typescript

3.x

 

no class style component

 

eslint+prettier

 

lint on save

 

구조

main.ts : equivalent to main.js

shims-vue.d.ts : Helper file for Typescript. No need to modify it. give better definition showing what's going on vue files

tsconfig.json : configure options for ts compiler

 

add ts to existing vue 3 project

vue add typescript -> vue/cli upgrade

use class-style component syntax ? no

use babel alongside typescript? yes

convert all .js files to .ts ? yes

skip type checking of all declaration files ? yes

 

 

# creating components with Typescript

<script lang="ts">

import {defineComponent } from 'vue' : import Vue helper function

define component that works well with typescript

single file component에 설정할 것 전부이다.

 

# Type Fundamentals

Common Javascript types often encountered : String, Number, Boolean, Array, Function, Object

Typescript provides additional types to Javascript 

- Any : essentially disables any type checking

- Tuple : fixed length arrays with predefined data types

- Enum : allows you to define friendly names to a set of values

enum ArrowKeys {

  Up, // 1

  Down, //2

  Left= 0 , // 0

  Right = 5 //4

}

등등 더있음

 

Object 타입 정의방법

let person : {

  name : string

  age : number;

  activeAvenger: boolean;

  powers : string[];

} = {

  name: 'Peter Parker',

  age: 20,

  activeAvenger : true,

  powers: ['wall-crawl', 'spider-sense']

}

 

Limitaions of Predefined Types

 

The need for custom types is a common one. -> Type and Interface

 

What is Type

Type allows you to define alias how the data should be shaped.

 

type buttonType = 'primary' | 'secondary' | 'success' | 'danger'

let buttonStyles: buttonType = 'primary' // O

let buttonStyles : buttonType = 'error' // X

 

What is Interface

type for object

 

interface Hero {

  name : string;

  age : number;

  activeAvenger : boolean;

  powers : string[];

  universe : ComicUniverse; // type ComicUniverse = 'Marvel' | 'DC'

}

 

let person:Hero = {

  name: 'Peter Parker',

  age: 20,

  activeAvenger : true,

  powers: ['wall-crawl', 'spider-sense'],

  universe : 'Marvel'

}

 

Use Type except for an Object

 

# Data With Custom Types

Install VSCode extension VueDX : provide edtior service

 

src 폴더 밑에 types.ts 생성

export interface EventItem {

 id : number

 category : string

 title : string

 description : string

 location: string

 date: string

 time: string

 organizer: string

}

 

//Eventdetail.vue

import {EventItem} from '../types'

 

data(){

  event : {} as EventItem // Type Assertion

}

 

# Props With Types

 

import {EventItem, PropType} from '../types' // PropType: helper method

 

props : {

  event: {

   type: Object as PropType<EventItem>, // type : EventItem , type : Object as EventItem쓰면 에러뜬다. Props에서는 Vue에서 지정한 방법으로 타입을 지정해야한다

   required: true

  }

}

 

What is Generic?

function createList (item: number) : number[]{ // createNumberList가 아니야 reusable하게 다른 타입에서도 작동하게 만들자 => Generic

 const newList : number[] = [];

 newList.push(item);

 return newList;

}

 

const numberList = createList(123);

 

Generic은 함수에서 사용되는 변수의  type을 Dynamic하게 정의할 수 있도록 해준다

function createList<CustomType>(item: CustomType) : CustomType[]{

  const newList: CustomType[] = [];

  newList.push(item);

  return newList;

}

const numberList = createList<number>(123)

const stringList = createList<string>("Hello");

 

# Custom Methods with CustomTypes

 

1. Computed

For computed properties, focus on what type is returned

 

data(){

  return {

   events: [] as EventItem[]

  }

},

computed:{

  firstEvent(): EventItem {

   return this.events[0]

  }

}

 

2. Methods

For methods, add types for the parameters and return value if applicable

 

data(){

  return {

   events: [] as EventItem[]

  }

},

methods:{

  addEvent(newEvent: EventItem) {

   this.events.push(newEvent)

  },

  secondEvent(): EventItem{

   return this.events[1]

  }

}

 

# Composition API with Typescript

data: () => ({

  newTask : {

   label: '',

   type: 'personal',

  } as TodoItem,

  taskItems: [] as TodoItem[],

  listFilter: 'all'

}),

computed: {

  filteredTasks() : TodoItem[] {

   if(this.listFilter == 'complete'){

    return this.taskItems.filter((item:TodoItem) => item.isComplete === true)

   }else if(this.listFilter === 'incomplete'){

    return this.taskItems.filter((item.TodoItem)=>item.isComplete === false)

   }else{

     return this.taskItems

   }

  }

},

methos:{

  addTask() {

   this.taskItems.push({

     ...this.newTask,

     isComplete:false

   })

  }

}

 

Refactor this in composition api

 

setup(){

  const state = reactive({

  newTask : {

   label: '',

   type: 'personal',

  } as TodoItem,

  taskItems: [] as TodoItem[],

  listFilter: 'all'

});

 

  const filteredTasks = computed(()=> { // computed 내부의 return 타입을 보고 타입추론을 해준다

   if(state.listFilter == 'complete'){

    return state.taskItems.filter((item:TodoItem) => item.isComplete === true)

   }else if(state.listFilter === 'incomplete'){

    return state.taskItems.filter((item.TodoItem)=>item.isComplete === false)

   }else{

     return state.taskItems

   }

  })

 

  const addTask = ()=> {

   this.taskItems.push({

     ...this.newTask,

     isComplete:false

   })

  }

  return {

    ...toRefs(state),

    addTask, 

    filteredTasks

  }

 

}

'VueJS' 카테고리의 다른 글

Vue3 - 3.Type Fundamentals  (0) 2021.12.28
Vue3 - 2. Vue3 + Typescript  (0) 2021.12.28
vue3 - 0.주요 특징  (0) 2021.12.10
array / object prototype  (0) 2021.06.27
VueJs Project Architecture  (0) 2021.01.28
728x90

Vue3의 새로운 기능

Composition API

  • 재사용성, 구성과 가독성을 향상시켜준다
  • setup()

Multiple Root Element

  • 하나의 컴포넌트 안에서 여러개의 root element를 가질 수 있다.
    •  
    • <template> <div> <p>Hello, World</p> </div> <div> <p>Hello, World!!</p> </div> </template>

Teleport Component

  • 특정 컴포넌트를 DOM의 다른 위치에 렌더링 시켜준다. (React에서 Portal)
  • modal에서 사용하기 좋음
  • <!-- App.vue -->
    <teleport to=".modal"> <!-- #app style 영향을 안받는다 -->
      <modal>
        <template v-slot:header><h1>haha header</h1></template>
        <template v-slot:content>this is content</template>
      </modal>
    </teleport>

Suspense Component

  • 비동기 컴포넌트를 다루기위해 사용
  • 데이터 로딩이 끝날때까지 spinner와 같은 fallback component를 보여주는데 사용하기 좋음

Typescript Support

  • Vue application에서 Typescript를 쓸수있다. (Vue2에서는 어려웠음)

 

Vue3 시작하기

  1. node 설치
  2. vue/cli 설치
    •  
    • npm install -g @vue/cli​
  3. 프로젝트 생성
    • vue create 프로젝트명​
      
      //Manually select features
      //Choose Vue Version, Babel
      // 3.x
      //N

 

 

'VueJS' 카테고리의 다른 글

Vue3 - 3.Type Fundamentals  (0) 2021.12.28
Vue3 - 2. Vue3 + Typescript  (0) 2021.12.28
Vue3 - 1. Composition API  (0) 2021.12.11
array / object prototype  (0) 2021.06.27
VueJs Project Architecture  (0) 2021.01.28
728x90

Array

Array.apply(null,Array(length))

  • 특정 길이의 iterable한 Array 객체를 생성한다.
Array(7) // [,,,,,,,] 길이가 7인 배열. not iterable
Array.apply(null,Array(7)) // == Array(undefined,undefined,...,undefined) 길이가 7인 undefined 배열, iterable

Array.apply(null,Array(7)).map((el,i)=> i) // [0,1,2,3,4,5,6]

Array.of()

  • 전달인자의 개수나 데이터 타입에 관계없이 새 배열 인스턴스를 생성한다.
Array.of(7); // [7]
Array.of(1,2,3) // [1,2,3]

Array(7) // [ , , , , , ,] 길이가 7인 배열
Array(1,2,3) // [1,2,3]

Array.prototype.entries()

  • 배열의 각 익덱스에 대한 key/value 쌍을 가지는 새로운 Array Iterator 객체를 반환한다.
const arr = ['a','b','c'];

const iterator = arr.entries();

console.log(iterator.next().value);// [0,'a']

console.log(iterator.next().value);// [1,'b']

for( const [key,value] of arr.entries()){
  console.log(key, value) 
}
// 0,'a'
// 1,'b'
// 2.'c'

Array.prototpye.shift() / Array.prototype.unshift()

  • shift()
    • 배열에서 첫 번째 요소를 삭제하고 그 요소를 반환한다.
  • unshift()
    • 배열에서 첫 번째 요소를 추가하고 새로운 길이를 반환한다.
let arr = ['a','b','c'];

arr.shift();
console.log(arr);// ['b','c']

const newLength = arr.unshift('d'); 
console.log(arr); //['d','b','c']
console.log(newLength);// 3

Array.prototype.splice()

  • 배열에서 요소를 추가/삭제 하고 삭제한 요소 배열을 반환한다.
let arr = ['a','b','c'];
arr.splice(1,2,'k');
console.log(arr) // ['a','k']

Array.prototype.join()

  • 배열의 모든 요소를 연결해 하나의 문자열로 만든다.
let arr = ['a','b','c'];
console.log(arr.join('-'));//'a-b-c'
console.log(arr.join(''));//'abc'

Array.prototype.indexOf()

  • 배열에서 지정된 요소를 찾을 수 있는 첫번째 인덱스를 반환하고 존재하지 않으면 -1을 반환한다.
let arr = ['a','a','b'];
console.log(arr.indexOf('a')) // 0
console.log(arr.indexOf('a',2)) //1
console.log(arr.indexOf('c') // -1

Array.prototype.keys()

  • 배열의 각 _인덱스_를 키 값으로 가지는 새로운 Array Iterator객체를 반환한다.
let arr =['a','b','c'];
const iterator = arr.keys();

for(const key of iterator){
  console.log(key);
} // 0
  // 1
  // 2

Array.prototype.flat()

  • 모든 하위 배열 요소를 지정한 깊이까지 재귀적으로 이어붙인 새로운 배열을 생성한다.
let arr = ['a',['b','c'],[['d','e']]];
console.log(arr.flat()); // ['a','b','c',['d','e']]
console.log(arr.flat(2)); // ['a','b','c','d','e']
console.log(arr.flat(Infinity))//['a','b','c','d','e']

Array.prototype.flatMap();

  • 먼저 매핑함수를 사용해 각 엘리먼트에 대해 map 수행 후, 결과를 새로운 배열로 flatten한다. 기본적으로 flat depth는 1이다.
let arr = [1,2,3];

arr.map(item=>item*2); // [2,4,6]

arr.map(item=>[item*2]) // [[2],[4],[6]]
arr.flatMap(item=>[item*2]) // [2,4,6]

arr.flatMap(item=>[[item*2]]) // [[2],[4],[6]]

Array.from()

  • array-like object나 반복 가능한 객체(iterable object)를 얕게 복사해 새로운 Array 객체를 만든다.
console.log(Array.from('foo')); // ['f','o','o']

console.log(Array.from([1,2,3],x=>x+x); // [2,4,6]

 

Object

Object.assign()

  • 하나 이상의 원본 객체들로부터 모든 열거가능한 속성들을 대상 객체로 복사한다. 같은 key는 덮어씌워 새로운 값으로 갱신한다.
const target = {a:1,b:2};
const source = {b:4,c:5};

const returnTarget = Object.assign(target,source);

console.log(returnTarget); // {a:1,b:4,c:5}

console.log(target); // {a:1,b:4,c:5} target도 값이 갱신된다!!

Object.freeze()

  • 객체의 값을 변경할 수 없도록 동결한다. Object의 const라고 보면될듯하다.
const obj = {
  prop: 42
};

obj.prop = 41;

console.log(obj.prop); // 41

Object.freeze(obj); 

obj.prop = 40; // error in strict mode

console.log(obj.prop) // 41

 

String

'

String.prototype.match()

  • 문자열이 정규식과 매치도는 부분을 검색한다.
var str = 'For more information, see Chapter 3.4.5.1';
var re = /see (chapter \d+(\.\d)*)/i;
var found = str.match(re);

console.log(found);

String.prototype.padEnd() / String.prototype.padStart()

  • 현재 문자열에 다른 문자열을 채워 주어진 길이를 만족하는 새로운 문자열을 반환한다.
console.log(`abc`.padEnd(10)); // 'abc       '
console.log(`abc`.padEnd(10,'foo')); // `abcfoofoof`
console.log(`abc`.padEnd(6,'123456')); // `abc123`
console.log(`abc`.padEnd(1)); // `a`

String.prototype.slice()

  • 문자열의 일부를 추출하면서 새로운 문자열을 반환한다.
console.log(`abc`.slice(1)) // bc
console.log(`abc.slice(0,1)) // a
console.log(`abc`.slice(-1)) // c
console.log(`abc`.slice(-3,-2) // a

String.prototype.split()

  • 지정한 구분자를 이용하여 여러개의 문자열로 나눈다
console.log(`ab cd`.split(' ')); // ['ab'.'cd']
console.log(`ab cd`.split('')); //['a','b',' ','c','d']
console.log(`ab cd`.split()); // ['ab cd']

String.prototype.substring()

  • 문자열의 시작 인덱스부터 종료 인덱스 전까지 문자열의 부분 문자열을 반환한다.
const str = 'abcde'

console.log(str.substring(1,3)); // bc

console.log(str.substring(2)); // cde

String.prototype.trim() / String.prototype.trimEnd() / String.prototype.trimStart()

  • trim
    • 양끝의 공백(space, tab, NBSP)을 제거해준다.
  • trimEnd
    • 뒤의 공백을 제거해준다.
  • trimStart
    • 앞의 공백을 제거해준다.
const str = ' abcd '

console.log(str.trim()); 'abcd'
console.log(str.trimEnd()); ' abcd'
console.log(str.trinStart()); 'abcd '

 

Proxy

  • 특정 객체(array,object)를 감싸 프로퍼티 읽기, 쓰기와 같은 객체에 가해지는 작업을 중간에서 intercept하는 객체로 작업은 Proxy 자체에서 처리하기도 하고, 원래 객체가 처리하도록 넘겨주기도한다.

참고사이트1
참고사이트2

'VueJS' 카테고리의 다른 글

Vue3 - 3.Type Fundamentals  (0) 2021.12.28
Vue3 - 2. Vue3 + Typescript  (0) 2021.12.28
Vue3 - 1. Composition API  (0) 2021.12.11
vue3 - 0.주요 특징  (0) 2021.12.10
VueJs Project Architecture  (0) 2021.01.28
728x90
.
├─ README.md
├─ index.html
├─ webpack.config.js
├─ package.json
└─ src
   ├─ main.js
   ├─ App.vue
   ├─ components        컴포넌트
   │  ├─ common
   │  └─ ...
   ├─ routes            라우터
   │  ├─ index.js
   │  └─ routes.js
   ├─ views             라우터 페이지
   │  ├─ MainView.vue
   │  └─ ...
   ├─ store             상태 관리
   │  ├─ auth
   │  ├─ index.js
   │  └─ ...
   ├─ api               api 함수
   │  ├─ index.js
   │  ├─ users.js
   │  └─ ...
   ├─ utils             필터 등의 유틸리티 함수
   │  ├─ filters.js
   │  ├─ bus.js
   │  └─ ...
   ├─ mixins            믹스인
   │  ├─ index.js
   │  └─ ...
   ├─ plugins           플러그인
   │  ├─ ChartPlugin.js
   │  └─ ...
   ├─ translations      다국어
   │  ├─ index.js
   │  ├─ en.json
   │  └─ ...
   ├─ images            이미지
   ├─ fonts             폰트
   └─ assets            기타 자원
  • README(default) : 프로젝트에 대한 설명, 프로젝트 세팅방법, 프로젝트 구동 방법 등이 명시되어있다.
  • index.html(default) : SPA(Single Page Application)에서 보여지는 웹페이지가 반영되는 곳이다.
  • webpack.config.js(default) : webpack
  • package.json(default) : 프로젝트 실행 script, 프로젝트 세팅시 설치되는 package들이 명시되어있다.
  • src
    • main.js(default) :  vue 인스턴스를 새로 만들고 시작하는 부분으로, 전역으로 처리해야 할 일이 있으면 여기서 처리한다.
    • App.vue(default) : 최상위 Vue 파일
    • components : page의 요소가 될 UI들을 모아놓는다. components의 종류에따라 (ex. chart, dialog, ...) 폴더로 묶어 관리한다.
    • routes : page 이동을 관리한다. 보통 index.js에서 관리하며, 
    • view : App.vue에 반영될 사용자가 웹페이지에서 보게되는 page의 단위
    • store : VueJS 상태관리 역할을 하는 파일들을 모아놓는 폴더. module로 쪼개 관리한다.
    • api : api들을 모아놓은 폴더. api 기능별로 파일로 묶어 관리한다
    • utils(optional) : 여러 component에서 재사용되는 함수(ex. regex value testing),상수(ex. role),필터를 모아놓은 폴더.
    • mixins : 여러 component에서 재사용되는 기능들(ex.created,mounted,data,methods...)을 모아놓은 폴더.
    • plugins : Vue에 전역수준으로 추가하기 원하는 기능(ex. vuex,chartJS...)들을 모아놓은 폴더.
    • translation(optional) : 다국어를 지원. vue i18n이라는 플러그인(자동번역 아님)에 통합하여 주로 사용한다. 
    • images(optional) : page에서 사용하는 이미지들을 모아놓는 폴더
    • fonts(optional) : 폰트들을 모아놓는 폴더
    • assets(default) :  css 또는 favicon.ico 같은 image나 font를 제외한 자원들을 모아놓는 폴더

 

'VueJS' 카테고리의 다른 글

Vue3 - 3.Type Fundamentals  (0) 2021.12.28
Vue3 - 2. Vue3 + Typescript  (0) 2021.12.28
Vue3 - 1. Composition API  (0) 2021.12.11
vue3 - 0.주요 특징  (0) 2021.12.10
array / object prototype  (0) 2021.06.27

+ Recent posts