primevue-mirror/README.md

88 lines
2.9 KiB
Markdown
Raw Normal View History

2019-05-27 10:32:08 +00:00
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue)
2020-03-02 14:59:54 +00:00
[![PrimeVue Hero](https://www.primefaces.org/wp-content/uploads/2020/03/primevue-github-02032020.jpg "PrimeVue Hero")](https://www.primefaces.org/primevue)
2019-05-27 10:32:08 +00:00
# PrimeVue
2019-05-27 18:20:41 +00:00
[![PrimeVue Logo](https://www.primefaces.org/wp-content/uploads/2019/05/primevue-logo-200.png "PrimeVue")](https://www.primefaces.org/primevue)
2019-05-27 10:32:08 +00:00
PrimeVue is available at npm, if you have an existing application run the following commands to download PrimeVue and PrimeIcons to your project.
```js
npm install primevue --save
npm install primeicons --save
```
2019-05-27 10:32:08 +00:00
### Module Loader
This is the recommended way if your application uses [vue-cli](https://cli.vuejs.org/) or has a webpack based build with [vue-loader](https://github.com/vuejs/vue-loader) configured. Import the components as .vue files for seamless integration within your project where path of each component is available at the "import" section of a component documentation.
```js
//import {ComponentName} from 'primevue/{componentname}';
2020-01-21 07:06:29 +00:00
import Dialog from 'primevue/dialog';
```
2019-05-27 10:32:08 +00:00
In the next step, register the component with the tag name you'd like to use.
```js
Vue.component('Dialog', Dialog);
```
2019-05-27 10:32:08 +00:00
Then you'll be able to utilize the component in your application.
2019-05-27 10:37:44 +00:00
```html
2019-05-27 10:32:08 +00:00
<Dialog></Dialog>
```
2019-05-27 10:32:08 +00:00
### Script Tag
Other alternative is utilizing the components directly within the browser with UMD packages.
2019-05-27 10:37:44 +00:00
```html
2019-05-27 10:32:08 +00:00
<meta charset="utf-8">
<title>calendar demo</title>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/primevue/components/calendar/calendar.umd.js"></script>
<div id="app">
<p-calendar></p-calendar>
</div>
<script>
new Vue({
components: {
'p-calendar': calendar
}
}).$mount('#app')
</script>
```
2019-05-27 10:32:08 +00:00
### 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.
```js
dependencies: {
"vue": "^2.6.10",
2020-01-21 07:06:29 +00:00
"primeicons": "^2.0.0"
2019-05-27 10:32:08 +00:00
}
```
2019-05-27 10:32:08 +00:00
Here is the list of components with 3rd party dependencies.
Component | Dependency
--- | ---
Charts | Charts.js 2.1.x+
Editor | Quill.js 1.3.3+
FullCalendar | FullCalendar 4.0.2+
PrimeFlex | DataView
### Styles
The css dependencies are as follows, note that you may change the theme with another one of your choice. If you are using a bundler such as webpack with a css loader you may import them to your main application component.
```javascript
2020-05-16 08:13:09 +00:00
primevue/resources/themes/saga-blue/theme.css //theme
2020-01-21 07:06:29 +00:00
primevue/resources/primevue.min.css //core css
2019-05-27 10:32:08 +00:00
primeicons/primeicons.css //icons
```
2019-05-27 10:32:08 +00:00
### Quickstart
2019-05-27 10:33:23 +00:00
An example application based on vue-cli is available at [GitHub](https://github.com/primefaces/primevue-quickstart).