0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

LikeHeaderでローカル登録したコンポーネントをAppで表示する

Last updated at Posted at 2021-05-08

(1)LikeHeader.vueファイルを作る

20210508-131637.png

(2)importしてコンポーネント登録する

src/App.vue
<template>
<div>
  <LikeHeader></LikeHeader>
  <LikeNumber></LikeNumber>
</div>
</template>

<script>
import LikeHeader from "./LikeHeader.vue";

export default {
  components: {
    LikeHeader: LikeHeader
  }
};
</script>

*ES6では

src/App.vue
  components: {
    LikeHeader
  }

キーとバリューが同じ場合は省略してかける

まずLikeHeaderファイルをコードディング

src/LikeHeader.vue
<template>
  <h1>いいね</h1>
</template>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?