init
This commit is contained in:
44
components/base/app-button/index.js
Normal file
44
components/base/app-button/index.js
Normal file
@@ -0,0 +1,44 @@
|
||||
Component({
|
||||
options: {
|
||||
multipleSlots: true
|
||||
},
|
||||
properties: {
|
||||
text: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
value: 'primary'
|
||||
},
|
||||
variant: {
|
||||
type: String,
|
||||
value: 'base'
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
value: 'medium'
|
||||
},
|
||||
block: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
shape: {
|
||||
type: String,
|
||||
value: 'rectangle'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTap(event) {
|
||||
this.triggerEvent('tap', event.detail)
|
||||
}
|
||||
}
|
||||
})
|
||||
6
components/base/app-button/index.json
Normal file
6
components/base/app-button/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-button": "tdesign-miniprogram/button/button"
|
||||
}
|
||||
}
|
||||
14
components/base/app-button/index.wxml
Normal file
14
components/base/app-button/index.wxml
Normal file
@@ -0,0 +1,14 @@
|
||||
<t-button
|
||||
class="app-button"
|
||||
theme="{{theme}}"
|
||||
variant="{{variant}}"
|
||||
size="{{size}}"
|
||||
block="{{block}}"
|
||||
disabled="{{disabled}}"
|
||||
loading="{{loading}}"
|
||||
shape="{{shape}}"
|
||||
bind:tap="handleTap"
|
||||
>
|
||||
<block wx:if="{{text}}">{{text}}</block>
|
||||
<slot></slot>
|
||||
</t-button>
|
||||
7
components/base/app-button/index.wxss
Normal file
7
components/base/app-button/index.wxss
Normal file
@@ -0,0 +1,7 @@
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.app-button {
|
||||
width: 100%;
|
||||
}
|
||||
Reference in New Issue
Block a user