LoginSignup
4
3

More than 5 years have passed since last update.

nuxt上でvueを書く際の注意点

Posted at

nuxt上でvueを書く際の注意点

本来vueは

  • new vueを宣言
  • componentの名前をelで指定してその中で処理

するものだがnuxtはpageフォルダ以下のtemplateがcomponentなので宣言する必要はない

pages/index.vue
<template>
 <div>
  <input v-model="message" placeholder="edit me">
  <p>Message is: {{ message }}</p>
 </div>
</template>
<script>
export default {
  data: () => ({
    message: ''
  })
}
</script>
4
3
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
4
3