|
3 | 3 | <wd-toast /> |
4 | 4 |
|
5 | 5 | <view @click="closeOutside" class="wrapper"> |
| 6 | + <demo-block title="位置"> |
| 7 | + <wd-radio-group v-model="placement" inline shape="dot"> |
| 8 | + <wd-radio value="bottom" custom-class="custom-radio">bottom</wd-radio> |
| 9 | + <wd-radio value="bottom-start" custom-class="custom-radio">bottom-start</wd-radio> |
| 10 | + <wd-radio value="bottom-end" custom-class="custom-radio">bottom-end</wd-radio> |
| 11 | + <wd-radio value="top" custom-class="custom-radio">top</wd-radio> |
| 12 | + <wd-radio value="top-start" custom-class="custom-radio">top-start</wd-radio> |
| 13 | + <wd-radio value="top-end" custom-class="custom-radio">top-end</wd-radio> |
| 14 | + <wd-radio value="left" custom-class="custom-radio">left</wd-radio> |
| 15 | + <wd-radio value="left-start" custom-class="custom-radio">left-start</wd-radio> |
| 16 | + <wd-radio value="left-end" custom-class="custom-radio">left-end</wd-radio> |
| 17 | + <wd-radio value="right" custom-class="custom-radio">right</wd-radio> |
| 18 | + <wd-radio value="right-start" custom-class="custom-radio">right-start</wd-radio> |
| 19 | + <wd-radio value="right-end" custom-class="custom-radio">right-end</wd-radio> |
| 20 | + </wd-radio-group> |
| 21 | + </demo-block> |
6 | 22 | <demo-block custom-class="pop" title="基本用法"> |
7 | 23 | <view class="center"> |
8 | | - <wd-popover id="pop1" content="这是一段内容。" v-model="show1" @change="handleChange1"> |
| 24 | + <wd-popover id="pop1" content="这是一段内容。" :placement="placement" v-model="show1" @change="handleChange1"> |
9 | 25 | <wd-button data-id="pop1">点击展示</wd-button> |
10 | 26 | </wd-popover> |
11 | 27 | </view> |
12 | 28 | </demo-block> |
13 | 29 |
|
14 | 30 | <demo-block custom-class="pop" title="嵌套信息"> |
15 | 31 | <view class="center list"> |
16 | | - <wd-popover v-model="show2" use-content-slot @change="handleChange2"> |
| 32 | + <wd-popover v-model="show2" use-content-slot :placement="placement" @change="handleChange2"> |
17 | 33 | <template #content> |
18 | 34 | <view class="pop-content">这是一段自定义样式的内容。</view> |
19 | 35 | </template> |
|
24 | 40 |
|
25 | 41 | <demo-block custom-class="pop" title="列表展示"> |
26 | 42 | <view class="center list"> |
27 | | - <wd-popover v-model="show3" mode="menu" :content="menu" @menuclick="link" @change="handleChange3"> |
| 43 | + <wd-popover v-model="show3" mode="menu" :placement="placement" :content="menu" @menuclick="link" @change="handleChange3"> |
28 | 44 | <wd-button>列表</wd-button> |
29 | 45 | </wd-popover> |
30 | 46 | </view> |
|
36 | 52 | import { useToast } from '@/uni_modules/wot-design-uni' |
37 | 53 | import { ref } from 'vue' |
38 | 54 | import { useQueue } from '@/uni_modules/wot-design-uni' |
| 55 | +import type { PlacementType } from '@/uni_modules/wot-design-uni/components/wd-popover/types' |
39 | 56 |
|
40 | 57 | const { closeOutside } = useQueue() |
41 | 58 | const toast = useToast() |
42 | 59 |
|
43 | | -const show = ref<boolean>(false) |
| 60 | +const placement = ref<PlacementType>('bottom') |
| 61 | +
|
44 | 62 | const show1 = ref<boolean>(false) |
45 | 63 | const show2 = ref<boolean>(false) |
46 | 64 | const show3 = ref<boolean>(false) |
@@ -95,6 +113,10 @@ function handleChange3() { |
95 | 113 | overflow: visible !important; |
96 | 114 | padding: 10px; |
97 | 115 | } |
| 116 | +:deep(.custom-radio) { |
| 117 | + height: 32px !important; |
| 118 | + line-height: 32px !important; |
| 119 | +} |
98 | 120 | .wrapper { |
99 | 121 | width: 100%; |
100 | 122 | height: 100vh; |
|
0 commit comments