nuxt.js で vue-generate-component を使う

2021/04/28

vue.js

Nuxt.js

> npm install vue-generate-component
> npx vgc components/karaage-header
> npx vgc components/karaage-header --style scss
> npx vgc components/karaage-header --script ts --spec ts
> npx vgc components/karaage-header --style scss --script ts --spec js

To use

<template>
  <karaage-header />
</template>

nuxt.js のTS設定

> npm install --save vue-property-decorator vue-class-component nuxt-property-decorator

sass 使う場合以下も https://ja.nuxtjs.org/docs/2.x/configuration-glossary/configuration-css/

> npm install --save-dev sass sass-loader@10 fibers