Update vite doc

pull/5507/head
Cagatay Civici 2024-04-01 12:54:05 +03:00
parent 0e70f79124
commit e25711fb48
4 changed files with 20 additions and 52 deletions

View File

@ -1,16 +1,7 @@
<template> <template>
<DocSectionText v-bind="$attrs"> <DocSectionText v-bind="$attrs">
<p> <p>Styled mode is based on pre-skinned components with opinionated themes, default theme Aura with emerald as the primary color. See the <NuxtLink to="/theming/styled">styled mode</NuxtLink> documentation to for customization.</p>
Styled mode is based on pre-skinned components with opinionated themes like Material, Bootstrap or PrimeOne themes. Theme is the required css file to be imported, visit the <DocSectionCode :code="code" hideToggleCode importCode hideStackBlitz />
<NuxtLink to="/theming/#themes">Themes</NuxtLink> section for the complete list of available themes to choose from.
</p>
<DocSectionCode :code="code1" hideToggleCode importCode hideStackBlitz />
<p>
The style classes of PrimeVue are defined under the <i>primevue</i> CSS layer to be easier to customize by having low specificity. If you are using a CSS library that styles default HTML elements such as Tailwind Preflight, Bootstrap,
Normalize, or similar, a custom CSS layer configuration might be necessary. This only applies to Styled Mode as Unstyled Mode does not use any default styles or layers. View the <NuxtLink to="/csslayer">CSS Layer</NuxtLink> guide for more
information.
</p>
<DocSectionCode :code="code2" hideToggleCode importCode hideStackBlitz />
</DocSectionText> </DocSectionText>
</template> </template>
@ -18,24 +9,13 @@
export default { export default {
data() { data() {
return { return {
code1: { code: {
basic: ` basic: `
//in main.js import { createApp } from 'vue';
import 'primevue/resources/themes/aura-light-green/theme.css' import PrimeVueStyled from 'primevue/styled';
`
},
code2: {
basic: `
/* Order */
@layer reset, primevue;
/* Reset CSS */ const app = createApp(App);
@layer reset { app.use(PrimeVueStyled);
button,
input {
/* CSS to Reset */
}
}
` `
} }
}; };

View File

@ -1,11 +1,8 @@
<template> <template>
<DocSectionText v-bind="$attrs"> <DocSectionText v-bind="$attrs">
<p> <p>In unstyled mode, the components do not include any CSS so you'd need to style the components on your end. Visit the <NuxtLink to="/unstyled">Unstyled mode</NuxtLink> documentation for more information and examples.</p>
Unstyled mode is disabled by default for all components. Using the PrimeVue plugin during installation, set <i>unstyled</i> as true to enable it globally. Visit the <NuxtLink to="/unstyled">Unstyled mode</NuxtLink> documentation for more
information and examples.
</p>
<DocSectionCode :code="code1" hideToggleCode importCode hideStackBlitz /> <DocSectionCode :code="code1" hideToggleCode importCode hideStackBlitz />
<p>In unstyled mode, you'd need to style the components on your end. If you are using Tailwind CSS, see the <a href="https://tailwind.primevue.org/vite/">Tailwind CSS Presets</a> project to get you started.</p> <p>If you are using Tailwind CSS, see the <a href="https://tailwind.primevue.org/vite/">Tailwind CSS Presets</a> project to get you started with styling the components with Tailwind utility classes.</p>
<DocSectionCode :code="code2" hideToggleCode importCode hideStackBlitz /> <DocSectionCode :code="code2" hideToggleCode importCode hideStackBlitz />
</DocSectionText> </DocSectionText>
</template> </template>
@ -17,23 +14,20 @@ export default {
code1: { code1: {
basic: ` basic: `
import { createApp } from "vue"; import { createApp } from "vue";
import PrimeVue from "primevue/config"; import PrimeVueUnstyled from "primevue/config";
const app = createApp(App); const app = createApp(App);
app.use(PrimeVue, { app.use(PrimeVueUnstyled);
unstyled: true
});
` `
}, },
code2: { code2: {
basic: ` basic: `
import { createApp } from 'vue'; import { createApp } from 'vue';
import PrimeVue from 'primevue/config'; import PrimeVueUnstyled from 'primevue/config';
import Lara from '@/presets/lara'; //import preset import Lara from '@/presets/lara'; //import preset
const app = createApp(App); const app = createApp(App);
app.use(PrimeVue, { app.use(PrimeVueUnstyled, {
unstyled: true,
pt: Lara //apply preset pt: Lara //apply preset
}); });
` `

View File

@ -1,6 +1,9 @@
<template> <template>
<DocSectionText v-bind="$attrs"> <DocSectionText v-bind="$attrs">
<p>Each component can be imported and registered individually so that you only bundle what you use. Import path is available in the documentation of the corresponding component.</p> <p>
Each component can be imported and registered individually so that you only bundle what you use. Import path is available in the documentation of the corresponding component. You may also use
<NuxtLink to="/autoimport">auto imports</NuxtLink> via the unplugin-vue-components plugin.
</p>
</DocSectionText> </DocSectionText>
<div class="card flex justify-content-center"> <div class="card flex justify-content-center">
<Button label="Check" icon="pi pi-check" /> <Button label="Check" icon="pi pi-check" />

View File

@ -22,7 +22,6 @@ import PluginDoc from '@/doc/vite/PluginDoc.vue';
import StyledModeDoc from '@/doc/vite/StyledModeDoc.vue'; import StyledModeDoc from '@/doc/vite/StyledModeDoc.vue';
import UnstyledModeDoc from '@/doc/vite/UnstyledModeDoc.vue'; import UnstyledModeDoc from '@/doc/vite/UnstyledModeDoc.vue';
import UsageDoc from '@/doc/vite/UsageDoc.vue'; import UsageDoc from '@/doc/vite/UsageDoc.vue';
import CreateVueDoc from '@/doc/vite/videos/CreateVueDoc.vue';
export default { export default {
data() { data() {
@ -36,12 +35,9 @@ export default {
{ {
id: 'plugin', id: 'plugin',
label: 'Plugin', label: 'Plugin',
component: PluginDoc component: PluginDoc,
}, description: `PrimeVue plugin is required to be installed as an application plugin to set up the default configuration. The plugin is lightweight, only sets up the configuration object without affecting your application. PrimeVue has two plugins; Styled and Unstyled. If you are
{ just getting started, we suggest to using the styled mode.`,
id: 'theming',
label: 'Theming',
description: 'PrimeVue has two theming modes; styled or unstyled.',
children: [ children: [
{ {
id: 'styled', id: 'styled',
@ -64,11 +60,6 @@ export default {
id: 'examples', id: 'examples',
label: 'Examples', label: 'Examples',
component: ExamplesDoc component: ExamplesDoc
},
{
id: 'videos',
label: 'Video Tutorial',
component: CreateVueDoc
} }
] ]
}; };