- 運営しているクリエイター
#JavaScript
Nuxt.js ルーティング(nuxt-linkによる動的切り替え)
ルーティングの定義pagesフォルダがこのような構成だった場合、
pages/--| index.vue--| projects/----| index.vue----| _id.vue
以下のようにルーティングが定義される。
router: { routes: [ { name: 'index', path: '/', component: 'pages/ind
Nuxt.js プロジェクト作成手順とフォルダの種類
プロジェクト作成vue init nuxt-community/starter-template my-app
パッケージのインストールcd my-appyarn #パッケージのインストールyarn dev #サーバー起動
ディレクトリ構造assets
画像、css(scss)、Javascriptの管理。
webpackでコンパイルなどしたいファイルを置く。
components
Vueコ