Go to file
Felix Bernhard c0f99345a3
Fixed #5038 - v2 Menu | disabled property as a function is not working with command prop (#5039)
2024-01-16 11:20:44 +00:00
.github update issue templates 2022-07-18 08:57:40 +03:00
api-generator Add modules to Editor (#4452) 2023-10-05 14:09:34 +01:00
public Fixed #3291 - PrimeFlex & PrimeIcons version update v2 2022-11-18 10:17:46 +03:00
src Fixed #5038 - v2 Menu | disabled property as a function is not working with command prop (#5039) 2024-01-16 11:20:44 +00:00
tests/unit new 2.x branch 2022-08-22 14:47:07 +01:00
.babelrc-lib babel config 2019-05-31 00:21:59 +03:00
.browserslistrc new 2.x branch 2022-08-22 14:47:07 +01:00
.editorconfig new 2.x branch 2022-08-22 14:47:07 +01:00
.eslintrc.js new 2.x branch 2022-08-22 14:47:07 +01:00
.gitignore new 2.x branch 2022-08-22 14:47:07 +01:00
.npmignore new 2.x branch 2022-08-22 14:47:07 +01:00
CHANGELOG.md Update CHANGELOG.md 2023-12-06 09:51:42 +03:00
LICENSE.md Update LICENSE.md 2022-08-23 11:47:51 +01:00
README.md Update README.md 2022-11-18 10:40:29 +03:00
babel.config.js new 2.x branch 2022-08-22 14:47:07 +01:00
build-lib.js new 2.x branch 2022-08-22 14:47:07 +01:00
gulpfile.js new 2.x branch 2022-08-22 14:47:07 +01:00
package-build.json Set new version 2023-12-06 10:11:46 +03:00
package.json Set new version 2023-12-06 10:02:01 +03:00
postcss.config.js Initialized repo with the sample project from vue-cli 2018-12-04 10:08:40 +03:00
vue.config.js new 2.x branch 2022-08-22 14:47:07 +01:00

README.md

License: MIT npm version Discord Chat

PrimeVue Hero

PrimeVue

Visit the PrimeVue Website for general information, demos and documentation.

Downloads

PrimeVue is available at npm, if you have an existing application run the following command to download it to your project.

npm install primevue@^2 --save
npm install primeicons --save

or

yarn add primevue@^2
yarn add primeicons

Import

Module

import PrimeVue from 'primevue/config';
import Dialog from 'primevue/dialog';

Vue.component('Dialog', Dialog);
Vue.use(PrimeVue);

Finally you'll be able to utilize the component in your application. See the Styles section to apply styling.

<Dialog></Dialog>

Script Tag

Other alternative is utilizing the components directly within the browser with the iife build. Note that PrimeVue does not provide a umd build.

<html>
    <head>
        <meta charset="utf-8">
        <title>calendar demo</title>
        <link href="https://unpkg.com/primevue^2/resources/themes/saga-blue/theme.css " rel="stylesheet">
        <link href="https://unpkg.com/primevue^2/resources/primevue.min.css " rel="stylesheet">
        <link href="https://unpkg.com/primeicons/primeicons.css " rel="stylesheet">
        <script src="https://unpkg.com/vue"></script>
        <script src="https://unpkg.com/primevue^2/calendar/calendar.umd.min.js"></script>

        <div id="app">
            <p-calendar></p-calendar>
        </div>

        <script>
            new Vue({
                components: {
                    'p-calendar': calendar
                }
            }).$mount('#app')
        </script>

    </head>
</html>

Configuration

Dependencies

Majority of PrimeVue components (95%) are native and there are some exceptions having 3rd party dependencies such as Quill for Editor.

In addition, components require PrimeIcons library for icons.

dependencies: {
    "vue": "^2.6.10",
    "primeicons": "^6.0.0"
}

Styles

The css dependencies are as follows, note that you may change the theme with another one of your choice.

primevue/resources/themes/saga-blue/theme.css       //theme
primevue/resources/primevue.min.css                 //core css
primeicons/primeicons.css                           //icons

If you are using a bundler such as webpack with a css loader you may also import them to your main application component.

import 'primevue/resources/themes/lara-light-indigo/theme.css';
import 'primevue/resources/primevue.min.css';
import 'primeicons/primeicons.css';

Nuxt Integration

PrimeVue has a built-in nuxt module. Open nuxt.config.js and add primevue/nuxt to the modules section along with your configuration.

nuxt.config.js

Open the nuxt configuration file and add the css dependencies.

modules: [
    [
        'primevue/nuxt', {
            theme: string,      //name of the theme, defaults to saga-blue
            ripple: boolean,    //whether the ripple animation is enabled, defaults to false
            components: [],     //an array of components to be registered
            directives: []      //an array of directives to be registered
        }
    ]
]

Here is an example configuration.

modules: [
    [
        'primevue/nuxt', {
            theme: 'md-light-indigo',
            ripple: true,
            components: ['InputText','Button','DataTable','Dialog'],
            directives: ['Tooltip','Badge']
        }
    ]
]

An alternative configuration is possible using the primevue property.

modules: ['primevue/nuxt'],
primevue: {
    theme: 'md-light-indigo',
    ripple: true,
    components: ['InputText','Button','DataTable','Dialog'],
    directives: ['Tooltip','Badge']
}