primevue-mirror/doc/icons/ConstantsDoc.vue

59 lines
1.4 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<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>
2023-02-28 17:40:48 +00:00
<DocSectionCode :code="code" hideToggleCode importCode hideCodeSandbox hideStackBlitz />
2023-02-28 08:29:30 +00:00
</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>