Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

feat: add primevue ui framework #859

Merged
merged 5 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ yarn create nuxt-app <my-project>
- [Element](https://github.com/ElemeFE/element)
- [Framevuerk](https://github.com/framevuerk/framevuerk)
- [Oruga](https://oruga.io/)
- [Primevue/](https://www.primefaces.org/primevue/)
- [Tachyons](https://github.com/tachyons-css/tachyons)
- [Tailwind CSS](https://github.com/tailwindcss/tailwindcss)
- [Windi CSS](https://github.com/windicss/windicss)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dependencies": {
"primevue": "^2.4.2",
"primeicons": "^4.1.0",
"primeflex": "^2.0.0"
}
}
9 changes: 8 additions & 1 deletion packages/cna-template/template/nuxt/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
'framevuerk/dist/framevuerk-nuxt.min.css'
<%_ } else if (ui === 'vant') { _%>
'vant/lib/index.css'
<%_ } else if (ui === 'primevue') { _%>
'primeflex/primeflex.css'
<%_ } _%>
],

Expand Down Expand Up @@ -120,6 +122,9 @@
'@chakra-ui/nuxt',
// https://go.nuxtjs.dev/emotion
'@nuxtjs/emotion',
<%_ } else if (ui === 'primevue') { _%>
// Doc: https://www.primefaces.org/primevue/showcase-v2/#/setup
'@primevue/nuxt',
<%_ } _%>
<%_ if (axios) { _%>
// https://go.nuxtjs.dev/axios
Expand Down Expand Up @@ -177,11 +182,13 @@
}
},
<%_ } _%>

// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
<%_ if (ui === 'element-ui') { _%>
transpile: [/^element-ui/],
<%_ } else if (ui === 'primevue') { _%>
// https://github.com/primefaces/primevue/issues/844
transpile: ['primevue'],
<%_ } _%>
}
}
1 change: 1 addition & 0 deletions packages/create-nuxt-app/lib/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = [
{ name: 'Element', value: 'element-ui' },
{ name: 'Framevuerk', value: 'framevuerk' },
{ name: 'Oruga', value: 'oruga' },
{ name: 'Primevue', value: 'primevue' },
{ name: 'Tachyons', value: 'tachyons' },
{ name: 'Tailwind CSS', value: 'tailwind' },
{ name: 'Windi CSS', value: 'windicss' },
Expand Down
89 changes: 88 additions & 1 deletion packages/create-nuxt-app/test/snapshots/index.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,93 @@ Generated by [AVA](https://avajs.dev).
}␊
`

## verify ui: Primevue

> Generated files

[
'.editorconfig',
'.gitignore',
'README.md',
'components/NuxtLogo.vue',
'components/Tutorial.vue',
'nuxt.config.js',
'package.json',
'pages/index.vue',
'static/favicon.ico',
'store/README.md',
]

> package.json

{
dependencies: {
'core-js': '^3.16.2',
nuxt: '^2.15.8',
primeflex: '^2.0.0',
primeicons: '^4.1.0',
primevue: '^2.4.2',
},
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: '' },␊
{ name: 'format-detection', content: 'telephone=no' }␊
],␊
link: [␊
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }␊
]␊
},␊
// Global CSS: https://go.nuxtjs.dev/config-css␊
css: [␊
'primeflex/primeflex.css'␊
],␊
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins␊
plugins: [␊
],␊
// 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: [␊
// Doc: https://www.primefaces.org/primevue/showcase-v2/#/setup␊
'@primevue/nuxt',␊
],␊
// Build Configuration: https://go.nuxtjs.dev/config-build␊
build: {␊
// https://github.com/primefaces/primevue/issues/844␊
transpile: ['primevue'],␊
}␊
}␊
`

## verify ui: Tachyons

> Generated files
Expand Down Expand Up @@ -1685,7 +1772,7 @@ Generated by [AVA](https://avajs.dev).
}␊
}␊
}␊
},␊
},
// Build Configuration: https://go.nuxtjs.dev/config-build␊
build: {␊
Expand Down
Binary file modified packages/create-nuxt-app/test/snapshots/index.test.js.snap
Binary file not shown.