primevue-mirror/apps/showcase/doc/icons/ConstantsDoc.vue

59 lines
1.3 KiB
Vue

<template>
<DocSectionText v-bind="$attrs">
<p>Constants API is available to reference icons easily when used programmatically.</p>
</DocSectionText>
<div class="card flex justify-center">
<Menu :model="items" />
</div>
<DocSectionCode :code="code" hideToggleCode importCode hideStackBlitz />
</template>
<script>
import { PrimeIcons } from '@primevue/core/api';
export default {
data() {
return {
items: [
{
label: 'File',
items: [
{ label: 'New', icon: PrimeIcons.PLUS },
{ label: 'Open', icon: PrimeIcons.DOWNLOAD }
]
}
],
code: {
basic: `
<template>
<div class="card flex justify-center">
<Menu :model="items" />
</div>
</template>
<script>
import { PrimeIcons } from '@primevue/core/api';
export default {
data() {
return {
items: [
{
label: 'File',
items: [
{ label: 'New', icon: PrimeIcons.PLUS },
{ label: 'Open', icon: PrimeIcons.DOWNLOAD }
]
}
]
};
}
};
<\/script>
`
}
};
}
};
</script>