primevue-mirror/apps/showcase/doc/configuration/InputVariantDoc.vue

30 lines
1.2 KiB
Vue
Raw Permalink Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>
Input fields come in two styles, default is <i>outlined</i> with borders around the field whereas <i>filled</i> alternative adds a background color to the field. Applying <i>p-variant-filled</i> to an ancestor of an input enables the
filled style. If you prefer to use filled inputs in the entire application, use a global container such as the document body or the application element to apply the style class. Note that in case you add it to the application element,
components that are teleported to the document body such as Dialog will not be able to display filled inputs as they are not a descendant of the application root element in the DOM tree, to resolve this case set inputVariant to
<i>filled</i> at PrimeVue configuration as well.
2023-02-28 08:29:30 +00:00
</p>
</DocSectionText>
2024-01-30 08:16:35 +00:00
<DocSectionCode :code="code" hideToggleCode importCode hideStackBlitz />
2023-02-28 08:29:30 +00:00
</template>
<script>
export default {
data() {
return {
code: {
2023-09-22 12:54:14 +00:00
basic: `
import {createApp} from "vue";
2023-02-28 08:29:30 +00:00
import PrimeVue from "primevue/config";
const app = createApp(App);
app.use(PrimeVue, { inputVariant: "filled" });
2023-09-22 12:54:14 +00:00
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>