-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(drawer): using new style (#1147)
* feat(drawer): using new style * feat(drawer): update style and demo
- Loading branch information
Showing
23 changed files
with
374 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<view class="demo"> | ||
<view class="demo-title">Drawer 弹出层</view> | ||
<view class="demo-desc">用作一组平行关系页面/内容的切换器,相较于Tab,同屏可展示更多的选项数量。</view> | ||
<view class="tdesign-demo-popup"> | ||
<t-demo title="01 类型"> | ||
<view class="demo-section__desc">基础抽屉</view> | ||
<base /> | ||
|
||
<view class="demo-section__desc">带图标抽屉</view> | ||
<icon-drawer /> | ||
</t-demo> | ||
</view> | ||
<t-demo title="01 组件类型" desc="基础抽屉"> | ||
<base /> | ||
</t-demo> | ||
<t-demo desc="带图标抽屉" /> | ||
<icon-drawer /> | ||
<t-demo title="02 组件样式" desc="带标题抽屉" /> | ||
<title /> | ||
<t-demo desc="带底部插槽样式" /> | ||
<footer /> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Component({ | ||
data: { | ||
visible: true, | ||
placement: 'left', | ||
baseSidebar: [ | ||
{ | ||
title: '菜单一', | ||
}, | ||
{ | ||
title: '菜单二', | ||
}, | ||
{ | ||
title: '菜单三', | ||
}, | ||
{ | ||
title: '菜单四', | ||
}, | ||
{ | ||
title: '菜单五', | ||
}, | ||
{ | ||
title: '菜单六', | ||
}, | ||
{ | ||
title: '菜单七', | ||
}, | ||
{ | ||
title: '菜单八', | ||
}, | ||
{ | ||
title: '菜单四', | ||
}, | ||
{ | ||
title: '菜单五', | ||
}, | ||
{ | ||
title: '菜单六', | ||
}, | ||
{ | ||
title: '菜单七', | ||
}, | ||
{ | ||
title: '菜单八', | ||
}, | ||
], | ||
}, | ||
|
||
methods: { | ||
openDrawerBase() { | ||
this.setData({ | ||
visible: true, | ||
sidebar: this.data.baseSidebar, | ||
}); | ||
}, | ||
|
||
itemClick(e) { | ||
console.log(e.detail); | ||
}, | ||
|
||
overlayClick(e) { | ||
console.log(e.detail); | ||
}, | ||
}, | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<view class="box"> | ||
<t-button variant="outline" bind:tap="openDrawerBase" block size="large" theme="primary">带底部插槽</t-button> | ||
</view> | ||
<t-drawer | ||
visible="{{visible}}" | ||
placement="{{placement}}" | ||
title="标题" | ||
items="{{baseSidebar}}" | ||
bind:overlay-click="overlayClick" | ||
bind:item-click="itemClick" | ||
> | ||
<t-button slot="footer" class="button-host" size="large=" block variant="outline">操作</t-button> | ||
</t-drawer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.box { | ||
margin: 32rpx; | ||
} | ||
|
||
.button-host { | ||
margin: 0 32rpx; | ||
margin-top: auto; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-drawer": "tdesign-miniprogram/drawer/drawer" | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/drawer/_example/icon-drawer/index.wxml → src/drawer/_example/icon/index.wxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Component({ | ||
data: { | ||
placement: 'left', | ||
baseSidebar: [ | ||
{ | ||
title: '菜单一', | ||
}, | ||
{ | ||
title: '菜单二', | ||
}, | ||
{ | ||
title: '菜单三', | ||
}, | ||
{ | ||
title: '菜单四', | ||
}, | ||
{ | ||
title: '菜单五', | ||
}, | ||
{ | ||
title: '菜单六', | ||
}, | ||
{ | ||
title: '菜单七', | ||
}, | ||
{ | ||
title: '菜单八', | ||
}, | ||
], | ||
}, | ||
|
||
methods: { | ||
openDrawerBase() { | ||
this.setData({ | ||
visible: true, | ||
sidebar: this.data.baseSidebar, | ||
}); | ||
}, | ||
|
||
itemClick(e) { | ||
console.log(e.detail); | ||
}, | ||
|
||
overlayClick(e) { | ||
console.log(e.detail); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-drawer": "tdesign-miniprogram/drawer/drawer" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<view class="box"> | ||
<t-button variant="outline" bind:tap="openDrawerBase" block size="large" theme="primary">带标题抽屉</t-button> | ||
</view> | ||
<t-drawer | ||
visible="{{visible}}" | ||
placement="{{placement}}" | ||
title="标题" | ||
items="{{sidebar}}" | ||
bind:overlay-click="overlayClick" | ||
bind:item-click="itemClick" | ||
></t-drawer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.box { | ||
margin: 32rpx; | ||
} |
Oops, something went wrong.