primevue-mirror/doc/icons/ConstantsDoc.vue

59 lines
1.4 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-content-center">
<Menu :model="items" />
</div>
<DocSectionCode :code="code" hideToggleCode import hideCodeSandbox hideStackBlitz />
</template>
<script>
import { PrimeIcons } from 'primevue/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-content-center">
<Menu :model="items" />
</div>
</template>
<script>
import { PrimeIcons } from 'primevue/api';
export default {
data() {
return {
items: [
{
label: 'File',
items: [
{ label: 'New', icon: PrimeIcons.PLUS },
{ label: 'Open', icon: PrimeIcons.DOWNLOAD }
]
}
]
};
}
};
<\/script>
`
}
};
}
};
</script>