-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: 增加button/cell/gap/icon/image/line/loading-icon等组件uni-app-x版本
- Loading branch information
jry
committed
Aug 21, 2024
1 parent
7b0faeb
commit b26f045
Showing
51 changed files
with
4,704 additions
and
4 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/uni_modules/uview-plus/components/up-button/button.uts
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,42 @@ | ||
/* | ||
* @Author : LQ | ||
* @Description : | ||
* @version : 1.0 | ||
* @Date : 2021-08-20 16:44:21 | ||
* @LastAuthor : LQ | ||
* @lastTime : 2021-08-20 16:51:27 | ||
* @FilePath : /u-view2.0/uview-ui/libs/config/props/button.js | ||
*/ | ||
export default { | ||
// button组件 | ||
button: { | ||
hairline: false, | ||
type: 'info', | ||
size: 'normal', | ||
shape: 'square', | ||
plain: false, | ||
disabled: false, | ||
loading: false, | ||
loadingText: '', | ||
loadingMode: 'spinner', | ||
loadingSize: 15, | ||
openType: '', | ||
formType: '', | ||
appParameter: '', | ||
hoverStopPropagation: true, | ||
lang: 'en', | ||
sessionFrom: '', | ||
sendMessageTitle: '', | ||
sendMessagePath: '', | ||
sendMessageImg: '', | ||
showMessageCard: false, | ||
dataName: '', | ||
throttleTime: 0, | ||
hoverStartTime: 0, | ||
hoverStayTime: 200, | ||
text: '', | ||
icon: '', | ||
iconColor: '', | ||
color: '' | ||
} | ||
} as UTSJSONObject |
156 changes: 156 additions & 0 deletions
156
src/uni_modules/uview-plus/components/up-button/props.uts
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,156 @@ | ||
import { defineMixin } from '../../libs/vue.uts' | ||
import defProps from './button.uts' | ||
let btnProp = defProps['button'] as UTSJSONObject | ||
|
||
export const buttonProps = defineMixin({ | ||
props: { | ||
// 是否细边框 | ||
hairline: { | ||
type: Boolean, | ||
default: btnProp['hairline'] | ||
}, | ||
// 按钮的预置样式,info,primary,error,warning,success | ||
type: { | ||
type: String, | ||
default: btnProp['type'] | ||
}, | ||
// 按钮尺寸,large,normal,small,mini | ||
size: { | ||
type: String, | ||
default: btnProp['size'] | ||
}, | ||
// 按钮形状,circle(两边为半圆),square(带圆角) | ||
shape: { | ||
type: String, | ||
default: btnProp['shape'] | ||
}, | ||
// 按钮是否镂空 | ||
plain: { | ||
type: Boolean, | ||
default: btnProp['plain'] | ||
}, | ||
// 是否禁止状态 | ||
disabled: { | ||
type: Boolean, | ||
default: btnProp['disabled'] | ||
}, | ||
// 是否加载中 | ||
loading: { | ||
type: Boolean, | ||
default: btnProp['loading'] | ||
}, | ||
// 加载中提示文字 | ||
loadingText: { | ||
type: [String], | ||
default: btnProp['loadingText'] | ||
}, | ||
// 加载状态图标类型 | ||
loadingMode: { | ||
type: String, | ||
default: btnProp['loadingMode'] | ||
}, | ||
// 加载图标大小 | ||
loadingSize: { | ||
type: Number, | ||
default: btnProp['loadingSize'] | ||
}, | ||
// 开放能力,具体请看uniapp稳定关于button组件部分说明 | ||
// https://uniapp.dcloud.io/component/button | ||
openType: { | ||
type: String, | ||
default: btnProp['openType'] | ||
}, | ||
// 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件 | ||
// 取值为submit(提交表单),reset(重置表单) | ||
formType: { | ||
type: String, | ||
default: btnProp['formType'] | ||
}, | ||
// 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 | ||
// 只微信小程序、QQ小程序有效 | ||
appParameter: { | ||
type: String, | ||
default: btnProp['appParameter'] | ||
}, | ||
// 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效 | ||
hoverStopPropagation: { | ||
type: Boolean, | ||
default: btnProp['hoverStopPropagation'] | ||
}, | ||
// 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效 | ||
lang: { | ||
type: String, | ||
default: btnProp['lang'] | ||
}, | ||
// 会话来源,open-type="contact"时有效。只微信小程序有效 | ||
sessionFrom: { | ||
type: String, | ||
default: btnProp['sessionFrom'] | ||
}, | ||
// 会话内消息卡片标题,open-type="contact"时有效 | ||
// 默认当前标题,只微信小程序有效 | ||
sendMessageTitle: { | ||
type: String, | ||
default: btnProp['sendMessageTitle'] | ||
}, | ||
// 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效 | ||
// 默认当前分享路径,只微信小程序有效 | ||
sendMessagePath: { | ||
type: String, | ||
default: btnProp['sendMessagePath'] | ||
}, | ||
// 会话内消息卡片图片,open-type="contact"时有效 | ||
// 默认当前页面截图,只微信小程序有效 | ||
sendMessageImg: { | ||
type: String, | ||
default: btnProp['sendMessageImg'] | ||
}, | ||
// 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示, | ||
// 用户点击后可以快速发送小程序消息,open-type="contact"时有效 | ||
showMessageCard: { | ||
type: Boolean, | ||
default: btnProp['showMessageCard'] | ||
}, | ||
// 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取 | ||
dataName: { | ||
type: String, | ||
default: btnProp['dataName'] | ||
}, | ||
// 节流,一定时间内只能触发一次 | ||
throttleTime: { | ||
type: Number, | ||
default: btnProp['throttleTime'] | ||
}, | ||
// 按住后多久出现点击态,单位毫秒 | ||
hoverStartTime: { | ||
type: Number, | ||
default: btnProp['hoverStartTime'] | ||
}, | ||
// 手指松开后点击态保留时间,单位毫秒 | ||
hoverStayTime: { | ||
type: Number, | ||
default: btnProp['hoverStayTime'] | ||
}, | ||
// 按钮文字,之所以通过props传入,是因为slot传入的话 | ||
// nvue中无法控制文字的样式 | ||
text: { | ||
type: [String], | ||
default: btnProp['text'] | ||
}, | ||
// 按钮图标 | ||
icon: { | ||
type: String, | ||
default: btnProp['icon'] | ||
}, | ||
// 按钮图标 | ||
iconColor: { | ||
type: String, | ||
default: btnProp['iconColor'] | ||
}, | ||
// 按钮颜色,支持传入linear-gradient渐变色 | ||
color: { | ||
type: String, | ||
default: btnProp['color'] | ||
} | ||
} | ||
}); |
Oops, something went wrong.