Repository: nuxt/create-nuxt-app
Pull request #710 (2021-02-07 20:04:07)

feat: add vant ui framework
Added Vant ui framework

clarkdo: Thanks!

Patch:
diff --git a/README.md b/README.md
index 49eca61..a96d280 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,7 @@ yarn create nuxt-app <my-project>
     - [View UI](https://www.iviewui.com/)
     - [Tachyons](https://github.com/tachyons-css/tachyons)
     - [Tailwind CSS](https://github.com/tailwindcss/tailwindcss)
+    - [Vant](https://github.com/youzan/vant)
     - [Vuesax](https://github.com/lusaxweb/vuesax)
     - [Vuetify](https://github.com/vuetifyjs/vuetify)
 1. Nuxt.js modules:
diff --git a/packages/cna-template/template/frameworks/vant/package.json b/packages/cna-template/template/frameworks/vant/package.json
new file mode 100644
index 0000000..3f5dc3a
--- /dev/null
+++ b/packages/cna-template/template/frameworks/vant/package.json
@@ -0,0 +1,5 @@
+{
+  "dependencies": {
+    "vant": "^2.12.6"
+  }
+}
diff --git a/packages/cna-template/template/frameworks/vant/plugins/vant.js b/packages/cna-template/template/frameworks/vant/plugins/vant.js
new file mode 100644
index 0000000..21c75da
--- /dev/null
+++ b/packages/cna-template/template/frameworks/vant/plugins/vant.js
@@ -0,0 +1,4 @@
+import Vue from 'vue'
+import Vant from 'vant'
+
+Vue.use(Vant)
diff --git a/packages/cna-template/template/nuxt/nuxt.config.js b/packages/cna-template/template/nuxt/nuxt.config.js
index 8dfeb04..d338e94 100644
--- a/packages/cna-template/template/nuxt/nuxt.config.js
+++ b/packages/cna-template/template/nuxt/nuxt.config.js
@@ -54,6 +54,8 @@
     'framevuerk/dist/framevuerk-nuxt.min.css'
     <%_ } else if (ui === 'vuesax') { _%>
     'vuesax/dist/vuesax.css'
+    <%_ } else if (ui === 'vant') { _%>
+    'vant/lib/index.css'
     <%_ } _%>
   ],
 
@@ -71,6 +73,8 @@
     '@/plugins/framevuerk'
     <%_ } else if (ui === 'vuesax') { _%>
     '@/plugins/vuesax'
+    <%_ } else if (ui === 'vant') { _%>
+    '@/plugins/vant'
     <%_ } _%>
   ],
 
diff --git a/packages/create-nuxt-app/lib/prompts.js b/packages/create-nuxt-app/lib/prompts.js
index d72cb26..6d6c937 100644
--- a/packages/create-nuxt-app/lib/prompts.js
+++ b/packages/create-nuxt-app/lib/prompts.js
@@ -41,6 +41,7 @@ module.exports = [
       { name: 'View UI', value: 'view-ui' },
       { name: 'Tachyons', value: 'tachyons' },
       { name: 'Tailwind CSS', value: 'tailwind' },
+      { name: 'Vant', value: 'vant' },
       { name: 'Vuesax', value: 'vuesax' },
       { name: 'Vuetify.js', value: 'vuetify' },
       { name: 'Oruga', value: 'oruga' }


Test patch:
diff --git a/packages/create-nuxt-app/test/snapshots/index.test.js.md b/packages/create-nuxt-app/test/snapshots/index.test.js.md
index 8b95e8b..cb4ecc4 100644
--- a/packages/create-nuxt-app/test/snapshots/index.test.js.md
+++ b/packages/create-nuxt-app/test/snapshots/index.test.js.md
@@ -1425,6 +1425,95 @@ Generated by [AVA](https://avajs.dev).
     }␊
     `
 
+## verify ui: Vant
+
+> Generated files
+
+    [
+      '.editorconfig',
+      '.gitignore',
+      'README.md',
+      'assets/README.md',
+      'components/Logo.vue',
+      'components/README.md',
+      'layouts/README.md',
+      'layouts/default.vue',
+      'middleware/README.md',
+      'nuxt.config.js',
+      'package.json',
+      'pages/README.md',
+      'pages/index.vue',
+      'plugins/README.md',
+      'plugins/vant.js',
+      'static/README.md',
+      'static/favicon.ico',
+      'store/README.md',
+    ]
+
+> package.json
+
+    {
+      dependencies: {
+        'core-js': '^3.8.3',
+        nuxt: '^2.14.12',
+        vant: '^2.12.6',
+      },
+      devDependencies: {},
+      private: true,
+      scripts: {
+        build: 'nuxt build',
+        dev: 'nuxt',
+        generate: 'nuxt generate',
+        start: 'nuxt start',
+      },
+    }
+
+> Generated nuxt.config.js
+
+    `export default {␊
+      // Global page headers: https://go.nuxtjs.dev/config-head␊
+      head: {␊
+        title: 'output',␊
+        htmlAttrs: {␊
+          lang: 'en'␊
+        },␊
+        meta: [␊
+          { charset: 'utf-8' },␊
+          { name: 'viewport', content: 'width=device-width, initial-scale=1' },␊
+          { hid: 'description', name: 'description', content: '' }␊
+        ],␊
+        link: [␊
+          { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }␊
+        ]␊
+      },␊
+    ␊
+      // Global CSS: https://go.nuxtjs.dev/config-css␊
+      css: [␊
+        'vant/lib/index.css'␊
+      ],␊
+    ␊
+      // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins␊
+      plugins: [␊
+        '@/plugins/vant'␊
+      ],␊
+    ␊
+      // Auto import components: https://go.nuxtjs.dev/config-components␊
+      components: true,␊
+    ␊
+      // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules␊
+      buildModules: [␊
+      ],␊
+    ␊
+      // Modules: https://go.nuxtjs.dev/config-modules␊
+      modules: [␊
+      ],␊
+    ␊
+      // Build Configuration: https://go.nuxtjs.dev/config-build␊
+      build: {␊
+      }␊
+    }␊
+    `
+
 ## verify ui: Vuesax
 
 > Generated files