feat: 接入小程序品牌组件基础层
This commit is contained in:
1 parent
8fd399f4c2
commit
1a9dc426f6
27 files changed
+158
-9
No files matched your search
@@ -0,0 +1,19 @@
|
||||
Component({
|
||||
options: { addGlobalClass: true },
|
||||
properties: {
|
||||
label: String,
|
||||
value: { type: String, value: "" },
|
||||
placeholder: String,
|
||||
type: { type: String, value: "text" },
|
||||
required: Boolean,
|
||||
maxlength: { type: Number, value: -1 },
|
||||
},
|
||||
methods: {
|
||||
handleChange(event) {
|
||||
this.triggerEvent("change", event.detail);
|
||||
},
|
||||
handleBlur(event) {
|
||||
this.triggerEvent("blur", event.detail);
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-input": "tdesign-miniprogram/input/input",
|
||||
"t-textarea": "tdesign-miniprogram/textarea/textarea"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="field"><view wx:if="{{label}}" class="label">{{label}}<text wx:if="{{required}}" class="required"> *</text></view><t-textarea wx:if="{{type === 'textarea'}}" value="{{value}}" placeholder="{{placeholder}}" maxlength="{{maxlength}}" bind:change="handleChange" bind:blur="handleBlur" /><t-input wx:else value="{{value}}" type="{{type}}" placeholder="{{placeholder}}" maxlength="{{maxlength}}" bind:change="handleChange" bind:blur="handleBlur" /></view>
|
||||
@@ -0,0 +1,18 @@
|
||||
.field {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.label {
|
||||
margin-bottom: 12rpx;
|
||||
color: var(--brand-color-text);
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.required {
|
||||
color: var(--brand-color-primary);
|
||||
}
|
||||
t-input,
|
||||
t-textarea {
|
||||
--td-input-bg-color: var(--brand-color-surface);
|
||||
--td-input-border-color: #eadfce;
|
||||
--td-input-border-radius: var(--brand-radius-control);
|
||||
}
|
||||
Reference in new issue
Block a user