papayaui 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,22 +2,30 @@
|
|
|
2
2
|
.#{$prefix}-badge {
|
|
3
3
|
position: relative;
|
|
4
4
|
display: inline-block;
|
|
5
|
+
|
|
5
6
|
&__content {
|
|
6
7
|
position: relative;
|
|
7
8
|
display: flex;
|
|
8
9
|
flex-direction: row;
|
|
9
|
-
line-height: 11px;
|
|
10
|
+
line-height: _var(badge-font-size, 11px);
|
|
10
11
|
text-align: center;
|
|
11
|
-
font-size: 11px;
|
|
12
|
+
font-size: _var(badge-font-size, 11px);
|
|
12
13
|
color: #fff;
|
|
13
|
-
padding: 2px 5px;
|
|
14
|
+
padding: _var(badge-padding, 2px 5px);
|
|
14
15
|
border-radius: 100px;
|
|
16
|
+
background-color: _var(badge-color, _var(color-danger));
|
|
15
17
|
}
|
|
18
|
+
|
|
16
19
|
&--dot &__content {
|
|
17
20
|
padding: 0;
|
|
18
21
|
width: 8px;
|
|
19
22
|
height: 8px;
|
|
20
23
|
}
|
|
24
|
+
|
|
25
|
+
&--border &__content {
|
|
26
|
+
border: _var(badge-border-width, 1px) solid _var(badge-border-color, #fff);
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
&--fixed &__content {
|
|
22
30
|
position: absolute;
|
|
23
31
|
transform: translate(50%, -50%);
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
2
|
+
<view
|
|
3
|
+
:class="[ns.b(), ns.is('dot', dot), ns.is('border', border), ns.is('fixed', !!$slots.default)]"
|
|
4
|
+
>
|
|
3
5
|
<slot></slot>
|
|
4
6
|
<view
|
|
5
7
|
v-if="visible"
|
|
6
8
|
:class="ns.e('content')"
|
|
7
|
-
:style="
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
:style="
|
|
10
|
+
ns.style({
|
|
11
|
+
backgroundColor: color,
|
|
12
|
+
top: getUnitValue(offset[1].toString()),
|
|
13
|
+
right: getUnitValue(offset[0].toString()),
|
|
14
|
+
borderColor,
|
|
15
|
+
})
|
|
16
|
+
"
|
|
12
17
|
>
|
|
13
18
|
<slot v-if="$slots.content" name="content"></slot>
|
|
14
19
|
<text v-else>{{ value }}</text>
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
<DocDemoBlock title="自定义位置" card>
|
|
15
15
|
<Demo5 />
|
|
16
16
|
</DocDemoBlock>
|
|
17
|
+
<DocDemoBlock title="边框" card>
|
|
18
|
+
<Demo7 />
|
|
19
|
+
</DocDemoBlock>
|
|
17
20
|
<DocDemoBlock title="独立展示" card>
|
|
18
21
|
<Demo6 />
|
|
19
22
|
</DocDemoBlock>
|
|
@@ -28,6 +31,7 @@ import Demo3 from '../../demos/badge/demo-3.vue'
|
|
|
28
31
|
import Demo4 from '../../demos/badge/demo-4.vue'
|
|
29
32
|
import Demo5 from '../../demos/badge/demo-5.vue'
|
|
30
33
|
import Demo6 from '../../demos/badge/demo-6.vue'
|
|
34
|
+
import Demo7 from '../../demos/badge/demo-7.vue'
|
|
31
35
|
</script>
|
|
32
36
|
|
|
33
37
|
<style lang="scss">
|
|
@@ -35,12 +39,11 @@ import Demo6 from '../../demos/badge/demo-6.vue'
|
|
|
35
39
|
:deep(.pa-badge) {
|
|
36
40
|
margin-right: 42px;
|
|
37
41
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
42
|
+
}
|
|
43
|
+
:deep(.demo-badge-block) {
|
|
44
|
+
width: 40px;
|
|
45
|
+
height: 40px;
|
|
46
|
+
background-color: rgb(238, 238, 238);
|
|
47
|
+
border-radius: 3px;
|
|
45
48
|
}
|
|
46
49
|
</style>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'
|
|
2
|
-
import { defaultNamespace } from '../../core/useNamespace'
|
|
3
2
|
|
|
4
3
|
export const badgeProps = {
|
|
5
4
|
/**
|
|
@@ -9,10 +8,7 @@ export const badgeProps = {
|
|
|
9
8
|
/**
|
|
10
9
|
* 徽标背景颜色
|
|
11
10
|
*/
|
|
12
|
-
color:
|
|
13
|
-
type: [String, Number] as PropType<CSSProperties['color']>,
|
|
14
|
-
default: `var(--${defaultNamespace}-color-danger)`,
|
|
15
|
-
},
|
|
11
|
+
color: [String, Number] as PropType<CSSProperties['color']>,
|
|
16
12
|
/**
|
|
17
13
|
* 是否展示为小点
|
|
18
14
|
*/
|
|
@@ -39,6 +35,14 @@ export const badgeProps = {
|
|
|
39
35
|
type: Boolean,
|
|
40
36
|
default: true,
|
|
41
37
|
},
|
|
38
|
+
/**
|
|
39
|
+
* 是否显示边框
|
|
40
|
+
*/
|
|
41
|
+
border: Boolean,
|
|
42
|
+
/**
|
|
43
|
+
* 边框颜色
|
|
44
|
+
*/
|
|
45
|
+
borderColor: [String, Number] as PropType<CSSProperties['color']>,
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
export type BadgeProps = ExtractPropTypes<typeof badgeProps>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defaultNamespace } from '../../core'
|
|
2
|
+
|
|
3
|
+
const Dialog = () => {
|
|
4
|
+
const node = uni
|
|
5
|
+
.createSelectorQuery()
|
|
6
|
+
.select(`#${defaultNamespace}-dialog`)
|
|
7
|
+
.node((result) => {
|
|
8
|
+
console.log('result', result)
|
|
9
|
+
})
|
|
10
|
+
.exec()
|
|
11
|
+
console.log(node)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default Dialog
|