Skip to content

Commit 35c45fe

Browse files
Update docs
1 parent 77ae033 commit 35c45fe

File tree

2 files changed

+67
-5
lines changed

2 files changed

+67
-5
lines changed

src/documentation/components/FeaturesTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
color="primary"
2121
icon="mdi:mdi-earth"
2222
size="x-small"
23-
/> icon next to it can be used with <code class="inline-code">createVDrilldownTable</code> as a global property.
23+
/> icon next to it can be used as a global property in <code class="inline-code">createVDrilldownTable</code>.
2424
</div>
2525
</v-col>
2626
</v-row>

src/documentation/sections/UsageSection.vue

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,41 @@
1515

1616
<v-col cols="12">
1717
<CodeBlock
18-
:code="usageCode"
18+
:code="usageGlobalPlugin"
1919
:highlightjs="codeBlockSettings.plugin === 'highlightjs'"
2020
lang="javascript"
2121
:prismjs="codeBlockSettings.plugin === 'prismjs'"
2222
:theme="codeBlockSettings.theme"
23+
>
24+
<template #label>
25+
Global Plugin Registration
26+
<br>
27+
<i>Global options have a higher precedence and will override local props</i>
28+
</template>
29+
</CodeBlock>
30+
</v-col>
31+
32+
<v-col cols="12">
33+
<CodeBlock
34+
:code="usageGlobalComponent"
35+
:highlightjs="codeBlockSettings.plugin === 'highlightjs'"
36+
label="Global Component Registration"
37+
lang="javascript"
38+
:prismjs="codeBlockSettings.plugin === 'prismjs'"
39+
:theme="codeBlockSettings.theme"
40+
/>
41+
</v-col>
42+
43+
44+
<v-col cols="12">
45+
<CodeBlock
46+
:code="usageIndividual"
47+
F
48+
:highlightjs="codeBlockSettings.plugin === 'highlightjs'"
49+
label="Local Registration"
50+
lang="html"
51+
:prismjs="codeBlockSettings.plugin === 'prismjs'"
52+
:theme="codeBlockSettings.theme"
2353
/>
2454
</v-col>
2555
</v-row>
@@ -38,11 +68,43 @@ const props = defineProps({
3868
const codeBlockSettings = computed(() => props.codeBlockOptions);
3969
const classes = inject('classes');
4070
41-
const usageCode = `import App from './App.vue';
42-
import VDrilldownTable from '@wdns/vuetify-drilldown-table';
43-
import { createApp } from 'vue';
71+
const usageGlobalPlugin = `import { createApp } from 'vue';
72+
import App from './App.vue';
73+
import { createVDrilldownTable } from '@wdns/vuetify-drilldown-table';
74+
75+
const app = createApp(App);
76+
77+
app.use(createVDrilldownTable({
78+
// options
79+
}));
80+
81+
app.mount('#app');`;
82+
83+
const usageGlobalComponent = `import { createApp } from 'vue';
84+
import App from './App.vue';
85+
import { VDrilldownTable } from '@wdns/vuetify-drilldown-table';
4486
4587
const app = createApp(App);
88+
4689
app.component('VDrilldownTable', VDrilldownTable);
90+
4791
app.mount('#app');`;
92+
93+
const usageIndividual = `<template>
94+
<VDrilldownTable
95+
:headers="headers"
96+
:items="items"
97+
/>
98+
</template>
99+
100+
\<script setup\>
101+
import VDrilldownTable from '@wdns/vuetify-drilldown-table';
102+
103+
const headers = ref([
104+
// ...
105+
]);
106+
const items = ref([
107+
// ...
108+
])
109+
\</script\>`;
48110
</script>

0 commit comments

Comments
 (0)