meeyoungchoi-front-dev / svelte-overview

프로젝트에 적용하기위해 svelte 찍먹하기
0 stars 0 forks source link

Feature: component로 분리 #5

Open meeyoungchoi-front-dev opened 5 months ago

meeyoungchoi-front-dev commented 5 months ago

Fruits를 출력해주는 코드를 컴포넌트로 분리하였다

컴포넌트란

컴포넌트 기반 개발의 특징

컴포넌트의 종류

https://hanamon.kr/%EC%BB%B4%ED%8F%AC%EB%84%8C%ED%8A%B8-component%EB%9E%80/

meeyoungchoi-front-dev commented 5 months ago
  1. Import it in the file where you’ll use the component (using the corresponding technique for importing [default]

    • A `

    • export creates a component prop

      • Svelte uses the export keyword to mark a variable declaration as a property or prop, which means it becomes accessible to consumers of the component ``

https://svelte.dev/repl/74593f36569a4c268d8a6ab277db34b5?version=3.12.1