This repository has been archived by the owner on Aug 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[improvement] Btn & Field: 支持原生属性 (#219)
* 增加 field 组件 submit 支持 * add new behavior * 增加 btn 支持项 * btn 文档补齐
- Loading branch information
1 parent
576d90d
commit 49db8e9
Showing
11 changed files
with
130 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
<button | ||
class="custom-class zan-btn {{ inGroup ? 'zan-btn--group' : '' }} {{ isLast ? 'zan-btn--last' : '' }} {{size ? 'zan-btn--'+size : ''}} {{size === 'mini' ? 'zan-btn--plain' : ''}} {{plain ? 'zan-btn--plain' : ''}} {{type ? 'zan-btn--'+type : ''}} {{loading ? 'zan-btn--loading' : ''}} {{disabled ? 'zan-btn--disabled' : ''}}" | ||
disabled="{{ disabled }}" | ||
open-type="{{ openType }}" | ||
app-parameter="{{ appParameter }}" | ||
hover-stop-propagation="{{ hoverStopPropagation }}" | ||
hover-start-time="{{ hoverStartTime }}" | ||
hover-stay-time="{{ hoverStayTime }}" | ||
lang="{{ lang }}" | ||
session-from="{{ sessionFrom }}" | ||
send-message-title="{{ sendMessageTitle }}" | ||
send-message-path="{{ sendMessagePath }}" | ||
send-message-img="{{ sendMessageImg }}" | ||
show-message-card="{{ showMessageCard }}" | ||
bindtap="handleTap" | ||
bindcontact="bindcontact" | ||
bindgetuserinfo="bindgetuserinfo" | ||
bindgetphonenumber="bindgetphonenumber" | ||
binderror="binderror" | ||
> | ||
<slot></slot> | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module.exports = Behavior({ | ||
properties: { | ||
loading: Boolean, | ||
// 在自定义组件中,无法与外界的 form 组件联动,暂时不开放 | ||
// formType: String, | ||
openType: String, | ||
appParameter: String, | ||
// 暂时不开放,直接传入无法设置样式 | ||
// hoverClass: { | ||
// type: String, | ||
// value: 'button-hover' | ||
// }, | ||
hoverStopPropagation: Boolean, | ||
hoverStartTime: { | ||
type: Number, | ||
value: 20 | ||
}, | ||
hoverStayTime: { | ||
type: Number, | ||
value: 70 | ||
}, | ||
lang: { | ||
type: String, | ||
value: 'en' | ||
}, | ||
sessionFrom: { | ||
type: String, | ||
value: '' | ||
}, | ||
sendMessageTitle: String, | ||
sendMessagePath: String, | ||
sendMessageImg: String, | ||
showMessageCard: String | ||
}, | ||
methods: { | ||
bindgetuserinfo({ detail = {} } = {}) { | ||
this.triggerEvent('getuserinfo', detail); | ||
}, | ||
bindcontact({ detail = {} } = {}) { | ||
this.triggerEvent('contact', detail); | ||
}, | ||
bindgetphonenumber({ detail = {} } = {}) { | ||
this.triggerEvent('getphonenumber', detail); | ||
}, | ||
binderror({ detail = {} } = {}) { | ||
this.triggerEvent('error', detail); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters