Skip to content

Commit

Permalink
Update PT doc
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Feb 23, 2024
1 parent 45fb504 commit ecfc277
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
53 changes: 53 additions & 0 deletions doc/passthrough/DeclarativeDoc.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<template>
<DocSectionText v-bind="$attrs">
<p>
The declarative syntax provides an alternative to the programmatic syntax. The attributes that start with <i>pt</i> are interpreted differently by the component based on the format below. An IDE extension is also being planned to
autocomplete the values for better developer experience in the future.
</p>
<DocSectionCode :code="code1" hideToggleCode hideStackBlitz />
<p>Here is another example using both syntax alternatives for the same options.</p>
<DocSectionCode :code="code2" hideToggleCode hideStackBlitz />
<DocSectionCode :code="code3" hideToggleCode hideStackBlitz />
</DocSectionText>
</template>

<script>
export default {
data() {
return {
code1: {
basic: `
<ComponentTag pt:[passthrough_key]:[attribute]="value" />
`
},
code2: {
basic: `
<Panel
:pt="{
root: {
class='"border-1 border-solid'
},
header: {
'data-test-id': 'testid',
class: 'bg-blue-500',
onClick: onHeaderClick
}
}"
>
`
},
code3: {
basic: `
<Panel
pt:root:class="border-1 border-solid"
pt:header:id="headerId"
pt:header:data-test-id="testId"
pt:header:class="bg-blue-500"
:pt:header:onClick="onHeaderClick"
>
`
}
};
}
};
</script>
6 changes: 6 additions & 0 deletions pages/passthrough/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<script>
import BasicDoc from '@/doc/passthrough/BasicDoc.vue';
import CustomCSSDoc from '@/doc/passthrough/CustomCSSDoc.vue';
import DeclarativeDoc from '@/doc/passthrough/DeclarativeDoc.vue';
import GlobalDoc from '@/doc/passthrough/GlobalDoc.vue';
import LifecycleDoc from '@/doc/passthrough/LifecycleDoc.vue';
import UsePassThroughDoc from '@/doc/passthrough/UsePassThroughDoc.vue';
Expand All @@ -31,6 +32,11 @@ export default {
label: 'Basic',
component: BasicDoc
},
{
id: 'declarative',
label: 'Declarative',
component: DeclarativeDoc
},
{
id: 'lifecycle',
label: 'Lifecycle',
Expand Down

0 comments on commit ecfc277

Please sign in to comment.