mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 01:12:37 +00:00
Add auto-import guide
This commit is contained in:
parent
0996e90188
commit
c3d791be08
9 changed files with 154 additions and 8 deletions
29
doc/autoimport/OverviewDoc.vue
Normal file
29
doc/autoimport/OverviewDoc.vue
Normal file
|
@ -0,0 +1,29 @@
|
|||
<template>
|
||||
<DocSectionText v-bind="$attrs">
|
||||
<p>PrimeVue components need to be imported and configured individually. In the next section, we'll cleanup the code using auto imports.</p>
|
||||
</DocSectionText>
|
||||
<DocSectionCode :code="code" hideToggleCode importCode hideCodeSandbox hideStackBlitz />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
code: {
|
||||
basic: `
|
||||
import { createApp } from "vue";
|
||||
import PrimeVue from "primevue/config";
|
||||
import InputText from 'primevue/inputtext';
|
||||
import Button from 'primevue/button';
|
||||
import App from './App.vue'
|
||||
const app = createApp(App);
|
||||
|
||||
app.use(PrimeVue);
|
||||
app.component('InputText', InputText);
|
||||
app.component('Button', Button);
|
||||
`
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue