Skip to content

Commit

Permalink
fix(drawer): fix the issue where the header does not behave as expect…
Browse files Browse the repository at this point in the history
…ed (#3385)
  • Loading branch information
cszhjh authored Nov 6, 2024
1 parent 37e7fb7 commit ba9bbe2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion script/generate-usage/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,8 @@ module.exports = {
drawer: `
<div>
<t-button @click="handleClick">Open Drawer</t-button>
<t-drawer v-bind="configProps" :visible.sync="visible" header="header">
<t-drawer v-bind="configProps" :visible.sync="visible">
<template #header>header</template>
<p>This is a Drawer</p>
</t-drawer>
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/drawer/_usage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<template #drawer="{ configProps }">
<div>
<t-button @click="handleClick">Open Drawer</t-button>
<t-drawer v-bind="configProps" :visible.sync="visible" header="header">
<t-drawer v-bind="configProps" :visible.sync="visible">
<template #header>header</template>
<p>This is a Drawer</p>
</t-drawer>
</div>
Expand All @@ -26,7 +27,7 @@ const panelList = [{ label: 'drawer', value: 'drawer' }];

const usageCodeMap = {
drawer:
'\n <div>\n <t-button @click="handleClick">Open Drawer</t-button>\n <t-drawer v-bind="configProps" :visible.sync="visible" header="header">\n <p>This is a Drawer</p>\n </t-drawer>\n </div>\n ',
'\n <div>\n <t-button @click="handleClick">Open Drawer</t-button>\n <t-drawer v-bind="configProps" :visible.sync="visible">\n <template #header>header</template>\n <p>This is a Drawer</p>\n </t-drawer>\n </div>\n ',
};
const usageCode = ref(`<template>${usageCodeMap[panelList[0].value].trim()}</template>`);

Expand Down

0 comments on commit ba9bbe2

Please sign in to comment.