mm_os 2.7.5 → 2.7.6
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<div class="mm_col ${' ' +
|
|
2
|
-
<div id="${config.id}" class="component_demo ${' ' +
|
|
1
|
+
<div class="mm_col ${' ' + config.layout}">
|
|
2
|
+
<div id="${config.id}" class="component_demo ${' ' + config.class}">
|
|
3
3
|
<div class="title">${@config.options.xxx}</div>
|
|
4
4
|
<div class="description">示例组件描述</div>
|
|
5
5
|
</div>
|
|
@@ -112,24 +112,46 @@ Component.prototype.option_model = function(block) {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
// 边距
|
|
115
|
-
|
|
116
|
-
`\n margin-top: ${o.margin_top
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
`\n margin-
|
|
115
|
+
if (o.margin_top) {
|
|
116
|
+
style += `\n margin-top: ${o.margin_top};`;
|
|
117
|
+
}
|
|
118
|
+
if (o.margin_right) {
|
|
119
|
+
style += `\n margin-right: ${o.margin_right};`;
|
|
120
|
+
}
|
|
121
|
+
if (o.margin_bottom) {
|
|
122
|
+
style += `\n margin-bottom: ${o.margin_bottom};`;
|
|
123
|
+
}
|
|
124
|
+
if (o.margin_left) {
|
|
125
|
+
style += `\n margin-left: ${o.margin_left};`;
|
|
126
|
+
}
|
|
123
127
|
|
|
124
128
|
// 填充
|
|
125
|
-
|
|
126
|
-
`\n padding-top: ${o.padding_top
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
`\n padding-
|
|
129
|
+
if (o.padding_top) {
|
|
130
|
+
style += `\n padding-top: ${o.padding_top};`;
|
|
131
|
+
}
|
|
132
|
+
if (o.padding_right) {
|
|
133
|
+
style += `\n padding-right: ${o.padding_right};`;
|
|
134
|
+
}
|
|
135
|
+
if (o.padding_bottom) {
|
|
136
|
+
style += `\n padding-bottom: ${o.padding_bottom};`;
|
|
137
|
+
}
|
|
138
|
+
if (o.padding_left) {
|
|
139
|
+
style += `\n padding-left: ${o.padding_left};`;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// 圆角
|
|
143
|
+
if (o.radius_top_right) {
|
|
144
|
+
style += `\n border-top-right-radius: ${o.radius_top_right};`;
|
|
145
|
+
}
|
|
146
|
+
if (o.radius_top_left) {
|
|
147
|
+
style += `\n border-top-left-radius: ${o.radius_top_left};`;
|
|
148
|
+
}
|
|
149
|
+
if (o.radius_bottom_right) {
|
|
150
|
+
style += `\n border-bottom-right-radius: ${o.radius_bottom_right};`;
|
|
151
|
+
}
|
|
152
|
+
if (o.radius_bottom_left) {
|
|
153
|
+
style += `\n border-bottom-left-radius: ${o.radius_bottom_left};`;
|
|
154
|
+
}
|
|
133
155
|
|
|
134
156
|
// 背景
|
|
135
157
|
if (o.bg_url) {
|
|
@@ -157,8 +179,30 @@ Component.prototype.option_model = function(block) {
|
|
|
157
179
|
} else {
|
|
158
180
|
style = "";
|
|
159
181
|
}
|
|
160
|
-
|
|
182
|
+
|
|
161
183
|
var layout = "";
|
|
184
|
+
if (block.layout) {
|
|
185
|
+
var o = block.layout.toJson();
|
|
186
|
+
if (o.default) {
|
|
187
|
+
layout += " col-" + o.default;
|
|
188
|
+
}
|
|
189
|
+
if (o.pc) {
|
|
190
|
+
layout += " col-xxl-" + o.pc;
|
|
191
|
+
}
|
|
192
|
+
if (o.note) {
|
|
193
|
+
layout += " col-xl-" + o.note;
|
|
194
|
+
}
|
|
195
|
+
if (o.pad) {
|
|
196
|
+
layout += " col-lg-" + o.pad;
|
|
197
|
+
}
|
|
198
|
+
if (o.pad_mini) {
|
|
199
|
+
layout += " col-sm-" + o.pad_mini;
|
|
200
|
+
}
|
|
201
|
+
if (o.phone) {
|
|
202
|
+
layout += " col-xs-" + o.phone;
|
|
203
|
+
}
|
|
204
|
+
layout = layout.trim();
|
|
205
|
+
}
|
|
162
206
|
|
|
163
207
|
var data = (block.data || '[]').toJson();
|
|
164
208
|
var attr = (block.attr || '{}').toJson();
|