@hlw-uni/mp-vue 2.1.56 → 2.1.57
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.
- package/package.json +1 -1
- package/src/components/hlw-ad/index.vue +58 -12
package/package.json
CHANGED
|
@@ -57,7 +57,7 @@ interface Props {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
const props = withDefaults(defineProps<Props>(), {
|
|
60
|
-
placement: "
|
|
60
|
+
placement: "center",
|
|
61
61
|
customStyle: "",
|
|
62
62
|
customClass: "",
|
|
63
63
|
});
|
|
@@ -69,17 +69,7 @@ const emit = defineEmits<{
|
|
|
69
69
|
|
|
70
70
|
/** 有 unit_id 才渲染 */
|
|
71
71
|
const visible = computed(() => !!props.unitId);
|
|
72
|
-
const style = computed(() =>
|
|
73
|
-
const safe = "24rpx";
|
|
74
|
-
const styleMap: Record<GridPlacement, string> = {
|
|
75
|
-
"left-top": `top:${safe};left:${safe};right:auto;bottom:auto;transform:none;`,
|
|
76
|
-
"right-top": `top:${safe};right:${safe};left:auto;bottom:auto;transform:none;`,
|
|
77
|
-
"left-middle": `top:50%;left:${safe};right:auto;bottom:auto;transform:translateY(-50%);`,
|
|
78
|
-
"right-middle": `top:50%;right:${safe};left:auto;bottom:auto;transform:translateY(-50%);`,
|
|
79
|
-
"left-bottom": `left:${safe};bottom:200rpx;right:auto;top:auto;transform:none;`,
|
|
80
|
-
"right-bottom": `right:${safe};bottom:200rpx;left:auto;top:auto;transform:none;`,
|
|
81
|
-
center: "top:50%;left:50%;right:auto;bottom:auto;transform:translate(-50%, -50%);",
|
|
82
|
-
};
|
|
72
|
+
const style = computed(() => props.customStyle);
|
|
83
73
|
|
|
84
74
|
function onLoad(event: any) {
|
|
85
75
|
emit("load", event);
|
|
@@ -105,4 +95,60 @@ function onError(event: any) {
|
|
|
105
95
|
overflow: visible;
|
|
106
96
|
background: transparent;
|
|
107
97
|
}
|
|
98
|
+
|
|
99
|
+
.hlw-ad--left-top {
|
|
100
|
+
top: 24rpx;
|
|
101
|
+
right: auto;
|
|
102
|
+
bottom: auto;
|
|
103
|
+
left: 24rpx;
|
|
104
|
+
transform: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.hlw-ad--right-top {
|
|
108
|
+
top: 24rpx;
|
|
109
|
+
right: 24rpx;
|
|
110
|
+
bottom: auto;
|
|
111
|
+
left: auto;
|
|
112
|
+
transform: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.hlw-ad--left-middle {
|
|
116
|
+
top: 50%;
|
|
117
|
+
right: auto;
|
|
118
|
+
bottom: auto;
|
|
119
|
+
left: 24rpx;
|
|
120
|
+
transform: translateY(-50%);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.hlw-ad--right-middle {
|
|
124
|
+
top: 50%;
|
|
125
|
+
right: 24rpx;
|
|
126
|
+
bottom: auto;
|
|
127
|
+
left: auto;
|
|
128
|
+
transform: translateY(-50%);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.hlw-ad--left-bottom {
|
|
132
|
+
top: auto;
|
|
133
|
+
right: auto;
|
|
134
|
+
bottom: 200rpx;
|
|
135
|
+
left: 24rpx;
|
|
136
|
+
transform: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.hlw-ad--right-bottom {
|
|
140
|
+
top: auto;
|
|
141
|
+
right: 24rpx;
|
|
142
|
+
bottom: 200rpx;
|
|
143
|
+
left: auto;
|
|
144
|
+
transform: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.hlw-ad--center {
|
|
148
|
+
top: 50%;
|
|
149
|
+
right: auto;
|
|
150
|
+
bottom: auto;
|
|
151
|
+
left: 50%;
|
|
152
|
+
transform: translate(-50%, -50%);
|
|
153
|
+
}
|
|
108
154
|
</style>
|