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

Commit 0fa8a67

Browse files
feat: add primevue ui framework (#859)
Co-authored-by: Xin Du (Clark) <[email protected]>
1 parent f3e61cd commit 0fa8a67

File tree

6 files changed

+104
-0
lines changed

6 files changed

+104
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ yarn create nuxt-app <my-project>
4444
- [Element](https://github.com/ElemeFE/element)
4545
- [Framevuerk](https://github.com/framevuerk/framevuerk)
4646
- [Oruga](https://oruga.io/)
47+
- [Primevue/](https://www.primefaces.org/primevue/)
4748
- [Tachyons](https://github.com/tachyons-css/tachyons)
4849
- [Tailwind CSS](https://github.com/tailwindcss/tailwindcss)
4950
- [Windi CSS](https://github.com/windicss/windicss)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"dependencies": {
3+
"primevue": "^2.4.2",
4+
"primeicons": "^4.1.0",
5+
"primeflex": "^2.0.0"
6+
}
7+
}

packages/cna-template/template/nuxt/nuxt.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
'framevuerk/dist/framevuerk-nuxt.min.css'
5656
<%_ } else if (ui === 'vant') { _%>
5757
'vant/lib/index.css'
58+
<%_ } else if (ui === 'primevue') { _%>
59+
'primeflex/primeflex.css'
5860
<%_ } _%>
5961
],
6062

@@ -120,6 +122,9 @@
120122
'@chakra-ui/nuxt',
121123
// https://go.nuxtjs.dev/emotion
122124
'@nuxtjs/emotion',
125+
<%_ } else if (ui === 'primevue') { _%>
126+
// Doc: https://www.primefaces.org/primevue/showcase-v2/#/setup
127+
'@primevue/nuxt',
123128
<%_ } _%>
124129
<%_ if (axios) { _%>
125130
// https://go.nuxtjs.dev/axios
@@ -182,6 +187,9 @@
182187
build: {
183188
<%_ if (ui === 'element-ui') { _%>
184189
transpile: [/^element-ui/],
190+
<%_ } else if (ui === 'primevue') { _%>
191+
// https://github.com/primefaces/primevue/issues/844
192+
transpile: ['primevue'],
185193
<%_ } _%>
186194
}
187195
}

packages/create-nuxt-app/lib/prompts.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module.exports = [
3939
{ name: 'Element', value: 'element-ui' },
4040
{ name: 'Framevuerk', value: 'framevuerk' },
4141
{ name: 'Oruga', value: 'oruga' },
42+
{ name: 'Primevue', value: 'primevue' },
4243
{ name: 'Tachyons', value: 'tachyons' },
4344
{ name: 'Tailwind CSS', value: 'tailwind' },
4445
{ name: 'Windi CSS', value: 'windicss' },

packages/create-nuxt-app/test/snapshots/index.test.js.md

+87
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,93 @@ Generated by [AVA](https://avajs.dev).
11671167
}␊
11681168
`
11691169

1170+
## verify ui: Primevue
1171+
1172+
> Generated files
1173+
1174+
[
1175+
'.editorconfig',
1176+
'.gitignore',
1177+
'README.md',
1178+
'components/NuxtLogo.vue',
1179+
'components/Tutorial.vue',
1180+
'nuxt.config.js',
1181+
'package.json',
1182+
'pages/index.vue',
1183+
'static/favicon.ico',
1184+
'store/README.md',
1185+
]
1186+
1187+
> package.json
1188+
1189+
{
1190+
dependencies: {
1191+
'core-js': '^3.19.1',
1192+
nuxt: '^2.15.8',
1193+
primeflex: '^2.0.0',
1194+
primeicons: '^4.1.0',
1195+
primevue: '^2.4.2',
1196+
},
1197+
devDependencies: {},
1198+
private: true,
1199+
scripts: {
1200+
build: 'nuxt build',
1201+
dev: 'nuxt',
1202+
generate: 'nuxt generate',
1203+
start: 'nuxt start',
1204+
},
1205+
}
1206+
1207+
> Generated nuxt.config.js
1208+
1209+
`export default {␊
1210+
// Global page headers: https://go.nuxtjs.dev/config-head␊
1211+
head: {␊
1212+
title: 'output',␊
1213+
htmlAttrs: {␊
1214+
lang: 'en'␊
1215+
},␊
1216+
meta: [␊
1217+
{ charset: 'utf-8' },␊
1218+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },␊
1219+
{ hid: 'description', name: 'description', content: '' },␊
1220+
{ name: 'format-detection', content: 'telephone=no' }␊
1221+
],␊
1222+
link: [␊
1223+
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }␊
1224+
]␊
1225+
},␊
1226+
1227+
// Global CSS: https://go.nuxtjs.dev/config-css␊
1228+
css: [␊
1229+
'primeflex/primeflex.css'␊
1230+
],␊
1231+
1232+
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins␊
1233+
plugins: [␊
1234+
],␊
1235+
1236+
// Auto import components: https://go.nuxtjs.dev/config-components␊
1237+
components: true,␊
1238+
1239+
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules␊
1240+
buildModules: [␊
1241+
],␊
1242+
1243+
// Modules: https://go.nuxtjs.dev/config-modules␊
1244+
modules: [␊
1245+
// Doc: https://www.primefaces.org/primevue/showcase-v2/#/setup␊
1246+
'@primevue/nuxt',␊
1247+
],␊
1248+
1249+
// Build Configuration: https://go.nuxtjs.dev/config-build␊
1250+
build: {␊
1251+
// https://github.com/primefaces/primevue/issues/844␊
1252+
transpile: ['primevue'],␊
1253+
}␊
1254+
}␊
1255+
`
1256+
11701257
## verify ui: Tachyons
11711258

11721259
> Generated files
Binary file not shown.

0 commit comments

Comments
 (0)