primevue-mirror/apps/showcase/doc/theming/styled/utils/UsePresetDoc.vue

25 lines
522 B
Vue
Raw Normal View History

2024-03-30 23:15:56 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Replaces the current presets entirely, common use case is changing the preset dynamically at runtime.</p>
</DocSectionText>
<DocSectionCode :code="code" hideToggleCode importCode hideStackBlitz />
</template>
<script>
export default {
data() {
return {
code: {
basic: `
2024-06-11 12:21:12 +00:00
import { usePreset } from '@primevue/themes';
2024-03-30 23:15:56 +00:00
const onButtonClick() {
usePreset(MyPreset);
}
`
}
};
}
};
</script>