2019-05-21 12:06:16 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div class="content-section introduction">
|
|
|
|
<div class="feature-intro">
|
|
|
|
<h1>Setup</h1>
|
|
|
|
<p>PrimeVue is a rich set of open source native components for Vue.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="content-section documentation">
|
|
|
|
<h3 style="margin:0">Download</h3>
|
|
|
|
<p>PrimeVue is available at npm, if you have an existing application run the following commands to download PrimeVue and PrimeIcons to your project.</p>
|
|
|
|
|
|
|
|
<CodeHighlight lang="js">
|
|
|
|
npm install primevue --save
|
|
|
|
npm install primeicons --save
|
|
|
|
</CodeHighlight>
|
|
|
|
|
2019-05-27 09:56:40 +00:00
|
|
|
<h3>Module Loader</h3>
|
|
|
|
<p>This is the recommended way if your application uses <a href="https://cli.vuejs.org/">vue-cli</a> or has a webpack based build with <a href="https://github.com/vuejs/vue-loader">vue-loader</a> 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.</p>
|
2019-05-21 12:06:16 +00:00
|
|
|
|
|
|
|
<CodeHighlight lang="js">
|
2020-01-14 10:41:34 +00:00
|
|
|
//import ComponentName from 'primevue/componentname';
|
2019-05-24 11:10:45 +00:00
|
|
|
|
2020-01-14 10:41:34 +00:00
|
|
|
import Dialog from 'primevue/dialog';
|
2019-05-24 11:10:45 +00:00
|
|
|
</CodeHighlight>
|
2019-05-21 12:06:16 +00:00
|
|
|
|
2019-05-24 11:10:45 +00:00
|
|
|
<p>In the next step, register the component with the tag name you'd like to use.</p>
|
|
|
|
<CodeHighlight lang="js">
|
|
|
|
Vue.component('Dialog', Dialog);
|
2019-05-21 12:06:16 +00:00
|
|
|
</CodeHighlight>
|
2019-05-24 11:10:45 +00:00
|
|
|
|
2019-05-27 09:56:40 +00:00
|
|
|
<p>Then you'll be able to utilize the component in your application.</p>
|
|
|
|
<CodeHighlight>
|
|
|
|
<Dialog></Dialog>
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Script Tag</h3>
|
|
|
|
<p>Other alternative is utilizing the components directly within the browser with UMD packages.</p>
|
|
|
|
<CodeHighlight>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>calendar demo</title>
|
2020-05-13 14:54:04 +00:00
|
|
|
<link href="https://unpkg.com/primevue/resources/themes/saga-blue/theme.css " rel="stylesheet">
|
2019-05-30 13:45:06 +00:00
|
|
|
<link href="https://unpkg.com/primevue/resources/primevue.min.css " rel="stylesheet">
|
|
|
|
<link href="https://unpkg.com/primeicons/primeicons.css " rel="stylesheet">
|
2019-05-27 09:56:40 +00:00
|
|
|
<script src="https://unpkg.com/vue"></script>
|
2019-05-30 13:45:06 +00:00
|
|
|
<script src="https://unpkg.com/primevue/components/calendar/calendar.umd.min.js"></script>
|
2019-05-27 09:56:40 +00:00
|
|
|
|
|
|
|
<div id="app">
|
|
|
|
<p-calendar></p-calendar>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
new Vue({
|
|
|
|
components: {
|
|
|
|
'p-calendar': calendar
|
|
|
|
}
|
|
|
|
}).$mount('#app')
|
|
|
|
</script>
|
|
|
|
</CodeHighlight>
|
|
|
|
|
2019-05-21 12:06:16 +00:00
|
|
|
<h3>Dependencies</h3>
|
2019-05-27 09:56:40 +00:00
|
|
|
<p>Majority of PrimeVue components (95%) are native and there are some exceptions having 3rd party dependencies such as Quill for Editor.</p>
|
2019-05-21 12:06:16 +00:00
|
|
|
<p>In addition, components require PrimeIcons library for icons.</p>
|
|
|
|
|
|
|
|
<CodeHighlight lang="js">
|
|
|
|
dependencies: {
|
|
|
|
"vue": "^2.6.10",
|
2020-05-13 14:54:04 +00:00
|
|
|
"primeicons": "^3.0.0"
|
2019-05-21 12:06:16 +00:00
|
|
|
}
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<p>Here is the list of components with 3rd party dependencies.</p>
|
|
|
|
<div class="doc-tablewrapper">
|
|
|
|
<table class="doc-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Component</th>
|
|
|
|
<th>Dependency</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>Charts</td>
|
|
|
|
<td>Charts.js 2.1.x+</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>Editor</td>
|
|
|
|
<td>Quill.js 1.3.3+</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>FullCalendar</td>
|
|
|
|
<td>FullCalendar 4.0.2+.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>PrimeFlex</td>
|
2019-05-27 09:56:40 +00:00
|
|
|
<td>DataView</td>
|
2019-05-21 12:06:16 +00:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2019-10-01 13:00:26 +00:00
|
|
|
|
2019-05-21 12:06:16 +00:00
|
|
|
<h3>Styles</h3>
|
2019-10-01 13:00:26 +00:00
|
|
|
<p>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
|
2019-05-21 12:06:16 +00:00
|
|
|
may import them to your main application component.</p>
|
2019-10-01 13:00:26 +00:00
|
|
|
|
2020-05-13 14:54:04 +00:00
|
|
|
<CodeHighlight lang="js">
|
|
|
|
primevue/resources/themes/saga-blue/theme.css //theme
|
|
|
|
primevue/resources/primevue.min.css //core css
|
2019-05-27 09:56:40 +00:00
|
|
|
primeicons/primeicons.css //icons
|
2020-05-13 14:54:04 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Free Themes</h3>
|
|
|
|
<p>PrimeVue ships with 25 free themes to choose from, import paths are as follows.</p>
|
|
|
|
<CodeHighlight lang="css">
|
|
|
|
primevue/resources/themes/saga-blue/theme.css
|
|
|
|
primevue/resources/themes/saga-cyan/theme.css
|
|
|
|
primevue/resources/themes/saga-deeppurple/theme.css
|
|
|
|
primevue/resources/themes/saga-green/theme.css
|
|
|
|
primevue/resources/themes/saga-indigo/theme.css
|
|
|
|
primevue/resources/themes/saga-orange/theme.css
|
|
|
|
primevue/resources/themes/saga-purple/theme.css
|
|
|
|
primevue/resources/themes/vela-blue/theme.css
|
|
|
|
primevue/resources/themes/vela-cyan/theme.css
|
|
|
|
primevue/resources/themes/vela-deeppurple/theme.css
|
|
|
|
primevue/resources/themes/vela-green/theme.css
|
|
|
|
primevue/resources/themes/vela-indigo/theme.css
|
|
|
|
primevue/resources/themes/vela-orange/theme.css
|
|
|
|
primevue/resources/themes/vela-purple/theme.css
|
|
|
|
primevue/resources/themes/vela-teal/theme.css
|
|
|
|
primevue/resources/themes/nova-light/theme.css
|
|
|
|
primevue/resources/themes/nova-dark/theme.css
|
|
|
|
primevue/resources/themes/nova-colored/theme.css
|
|
|
|
primevue/resources/themes/nova-vue/theme.css
|
|
|
|
primevue/resources/themes/luna-amber/theme.css
|
|
|
|
primevue/resources/themes/luna-blue/theme.css
|
|
|
|
primevue/resources/themes/luna-green/theme.css
|
|
|
|
primevue/resources/themes/luna-pink/theme.css
|
|
|
|
primevue/resources/themes/rhea/theme.css
|
2019-05-21 12:06:16 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Quickstart</h3>
|
2019-05-30 13:45:06 +00:00
|
|
|
<p>An <a href="https://github.com/primefaces/primevue-quickstart">example application</a> based on vue-cli is available at github.</p>
|
2019-10-01 13:00:26 +00:00
|
|
|
|
2019-05-30 13:45:06 +00:00
|
|
|
<h3>Typescript</h3>
|
|
|
|
<p>Typescript is fully supported as type definition files are provided in the npm package of PrimeVue. A sample <a href="https://github.com/primefaces/primevue-typescript-quickstart">typescript-primevue</a> application is available as well at github.</p>
|
|
|
|
|
2019-12-09 10:38:45 +00:00
|
|
|
<h3>Nuxt.js Integration</h3>
|
|
|
|
<p>PrimeVue can easily be added to a Nuxt.js with the following steps.</p>
|
|
|
|
<p><strong>1)</strong> Add primevue.js to the plugins folder with the components you'd like to use.</p>
|
|
|
|
<CodeHighlight class="language-javascript">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import InputText from 'primevue/inputtext';
|
|
|
|
import Button from 'primevue/button';
|
|
|
|
import Toast from 'primevue/toast';
|
|
|
|
import ToastService from 'primevue/toastservice';
|
|
|
|
|
|
|
|
Vue.use(ToastService);
|
|
|
|
|
|
|
|
Vue.component('InputText', InputText);
|
|
|
|
Vue.component('Button', Button);
|
|
|
|
Vue.component('Toast', Toast);
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<p><strong>2)</strong> Add requires CSS dependencies and the plugin configuration in nuxt.config.js.</p>
|
|
|
|
<CodeHighlight class="language-javascript">
|
|
|
|
css: [
|
|
|
|
{src: 'primevue/resources/primevue.min.css'},
|
|
|
|
{src: 'primevue/resources/themes/nova-light/theme.css'},
|
|
|
|
{src: 'primeicons/primeicons.css'},
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
{src:'~/plugins/primevue.js', mode: 'client'}
|
|
|
|
]
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<p>That is all, for a complete example please refer to the <a href="https://github.com/primefaces/primevue-nuxtjs-quickstart">primevue-nuxtjs-quickstart</a> sample.</p>
|
|
|
|
|
2019-10-01 13:00:26 +00:00
|
|
|
</div>
|
2019-05-21 12:06:16 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|