Skip to content

Commit 6e37b3f

Browse files
authored
feat(drawer): [drawer] modify smb theme (#2150)
1 parent c65b638 commit 6e37b3f

File tree

9 files changed

+39
-18
lines changed

9 files changed

+39
-18
lines changed

examples/sites/demos/pc/app/drawer/basic-usage-composition-api.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<tiny-button @click="openDrawer" type="primary"> 抽屉组件 </tiny-button>
44
<tiny-drawer title="标题" :visible="visible" @update:visible="visible = $event" @confirm="confirm">
5-
<div style="padding: 32px">内容区域</div>
5+
<div>内容区域</div>
66
</tiny-drawer>
77
</div>
88
</template>

examples/sites/demos/pc/app/drawer/basic-usage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<tiny-button @click="openDrawer" type="primary"> 抽屉组件 </tiny-button>
44
<tiny-drawer title="标题" :visible="visible" @update:visible="visible = $event" @confirm="confirm">
5-
<div style="padding: 32px">内容区域</div>
5+
<div>内容区域</div>
66
</tiny-drawer>
77
</div>
88
</template>

examples/sites/demos/pc/app/drawer/footer-slot-composition-api.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
<div>
33
<tiny-button @click="openDrawer" type="primary"> 底部插槽示例 </tiny-button>
44
<tiny-drawer title="标题" :visible="visible" @update:visible="visible = $event" :show-footer="true">
5-
<div style="padding: 32px">内容区域</div>
5+
<div>内容区域</div>
66
<template #footer>
7-
<div class="my-footer">
8-
<span>自定义底部文本</span>
9-
<tiny-button type="primary" native-type="submit" @click="visible = false">确认提交</tiny-button>
7+
<div class="foot-text">
8+
<div>
9+
<tiny-button type="text">文本按钮</tiny-button>
10+
</div>
11+
<div class="my-footer">
12+
<tiny-button native-type="submit" @click="visible = false">取消</tiny-button>
13+
<tiny-button type="primary" native-type="submit" @click="visible = false">确认</tiny-button>
14+
</div>
1015
</div>
1116
</template>
1217
</tiny-drawer>
@@ -30,4 +35,9 @@ function openDrawer() {
3035
justify-content: space-between;
3136
align-items: center;
3237
}
38+
.foot-text {
39+
width: 100%;
40+
display: flex;
41+
justify-content: space-between;
42+
}
3343
</style>

examples/sites/demos/pc/app/drawer/footer-slot.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ test('底部插槽', async ({ page }) => {
1111

1212
await page.waitForTimeout(300)
1313
await expect(footer).toBeVisible()
14-
await expect(footer.locator('> div')).toHaveClass('my-footer')
15-
await expect(footer).toContainText('自定义底部文本')
14+
await expect(footer.locator('> div')).toHaveClass('foot-text')
1615
})

examples/sites/demos/pc/app/drawer/footer-slot.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
<div>
33
<tiny-button @click="openDrawer" type="primary"> 底部插槽示例 </tiny-button>
44
<tiny-drawer title="标题" :visible="visible" @update:visible="visible = $event" :show-footer="true">
5-
<div style="padding: 32px">内容区域</div>
5+
<div>内容区域</div>
66

77
<template #footer>
8-
<div class="my-footer">
9-
<span>自定义底部文本</span>
10-
<tiny-button type="primary" native-type="submit" @click="visible = false">确认提交</tiny-button>
8+
<div class="foot-text">
9+
<div>
10+
<tiny-button type="text">文本按钮</tiny-button>
11+
</div>
12+
<div class="my-footer">
13+
<tiny-button native-type="submit" @click="visible = false">取消</tiny-button>
14+
<tiny-button type="primary" native-type="submit" @click="visible = false">确认</tiny-button>
15+
</div>
1116
</div>
1217
</template>
1318
</tiny-drawer>
@@ -41,4 +46,9 @@ export default {
4146
justify-content: space-between;
4247
align-items: center;
4348
}
49+
.foot-text {
50+
width: 100%;
51+
display: flex;
52+
justify-content: space-between;
53+
}
4454
</style>

examples/sites/demos/pc/app/drawer/show-footer-composition-api.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@update:visible="visible = $event"
1010
@confirm="confirm"
1111
>
12-
<div style="padding: 32px">内容区域</div>
12+
<div>内容区域</div>
1313
</tiny-drawer>
1414
</div>
1515
</template>

examples/sites/demos/pc/app/drawer/show-footer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@update:visible="visible = $event"
1010
@confirm="confirm"
1111
>
12-
<div style="padding: 32px">内容区域</div>
12+
<div>内容区域</div>
1313
</tiny-drawer>
1414
</div>
1515
</template>

examples/sites/demos/pc/app/drawer/tips-props-composition-api.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="demo-drawer">
33
<tiny-button @click="openDrawer" type="primary"> 展开抽屉 </tiny-button>
44
<tiny-drawer title="标题" :tipsProps="tipsProps" :visible="visible" @update:visible="visible = $event">
5-
<div style="padding: 32px">内容区域</div>
5+
<div>内容区域</div>
66
</tiny-drawer>
77
</div>
88
</template>
@@ -14,7 +14,8 @@ import { Drawer as TinyDrawer, Button as TinyButton } from '@opentiny/vue'
1414
const visible = ref(false)
1515
const tipsProps = reactive({
1616
content: '这是一段帮助提示。。。',
17-
placement: 'right'
17+
placement: 'right',
18+
effect: 'light'
1819
})
1920
2021
function openDrawer() {

examples/sites/demos/pc/app/drawer/tips-props.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="demo-drawer">
33
<tiny-button @click="openDrawer" type="primary"> 展开抽屉 </tiny-button>
44
<tiny-drawer title="标题" :tipsProps="tipsProps" :visible="visible" @update:visible="visible = $event">
5-
<div style="padding: 32px">内容区域</div>
5+
<div>内容区域</div>
66
</tiny-drawer>
77
</div>
88
</template>
@@ -20,7 +20,8 @@ export default {
2020
visible: false,
2121
tipsProps: {
2222
content: '这是一段帮助提示。。。',
23-
placement: 'right'
23+
placement: 'right',
24+
effect: 'light'
2425
}
2526
}
2627
},

0 commit comments

Comments
 (0)