props.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. export default {
  2. props: {
  3. // 是否细边框
  4. hairline: {
  5. type: Boolean,
  6. default: true
  7. },
  8. // 按钮的预置样式,info,primary,error,warning,success
  9. type: {
  10. type: String,
  11. default: 'info'
  12. },
  13. // 按钮尺寸,large,normal,small,mini
  14. size: {
  15. type: String,
  16. default: 'normal'
  17. },
  18. // 按钮形状,circle(两边为半圆),square(带圆角)
  19. shape: {
  20. type: String,
  21. default: 'square'
  22. },
  23. // 按钮是否镂空
  24. plain: {
  25. type: Boolean,
  26. default: false
  27. },
  28. // 是否禁止状态
  29. disabled: {
  30. type: Boolean,
  31. default: false
  32. },
  33. // 是否加载中
  34. loading: {
  35. type: Boolean,
  36. default: false
  37. },
  38. // 加载中提示文字
  39. loadingText: {
  40. type: [String, Number],
  41. default: ''
  42. },
  43. // 加载状态图标类型
  44. loadingMode: {
  45. type: String,
  46. default: 'spinner'
  47. },
  48. // 加载图标大小
  49. loadingSize: {
  50. type: [String, Number],
  51. default: 14
  52. },
  53. // 开放能力,具体请看uniapp稳定关于button组件部分说明
  54. // https://uniapp.dcloud.io/component/button
  55. openType: {
  56. type: String,
  57. default: ''
  58. },
  59. // 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
  60. // 取值为submit(提交表单),reset(重置表单)
  61. formType: {
  62. type: String,
  63. default: ''
  64. },
  65. // 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
  66. // 只微信小程序、QQ小程序有效
  67. appParameter: {
  68. type: String,
  69. default: ''
  70. },
  71. // 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
  72. hoverStopPropagation: {
  73. type: Boolean,
  74. default: true
  75. },
  76. // 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效
  77. lang: {
  78. type: String,
  79. default: 'en'
  80. },
  81. // 会话来源,open-type="contact"时有效。只微信小程序有效
  82. sessionFrom: {
  83. type: String,
  84. default: ''
  85. },
  86. // 会话内消息卡片标题,open-type="contact"时有效
  87. // 默认当前标题,只微信小程序有效
  88. sendMessageTitle: {
  89. type: String,
  90. default: ''
  91. },
  92. // 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效
  93. // 默认当前分享路径,只微信小程序有效
  94. sendMessagePath: {
  95. type: String,
  96. default: ''
  97. },
  98. // 会话内消息卡片图片,open-type="contact"时有效
  99. // 默认当前页面截图,只微信小程序有效
  100. sendMessageImg: {
  101. type: String,
  102. default: ''
  103. },
  104. // 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,
  105. // 用户点击后可以快速发送小程序消息,open-type="contact"时有效
  106. showMessageCard: {
  107. type: Boolean,
  108. default: true
  109. },
  110. // 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
  111. dataName: {
  112. type: String,
  113. default: ''
  114. },
  115. // 节流,一定时间内只能触发一次
  116. throttleTime: {
  117. type: [String, Number],
  118. default: 0
  119. },
  120. // 按住后多久出现点击态,单位毫秒
  121. hoverStartTime: {
  122. type: [String, Number],
  123. default: 0
  124. },
  125. // 手指松开后点击态保留时间,单位毫秒
  126. hoverStayTime: {
  127. type: [String, Number],
  128. default: 200
  129. },
  130. // 按钮文字,之所以通过props传入,是因为slot传入的话
  131. // nvue中无法控制文字的样式
  132. text: {
  133. type: [String, Number],
  134. default: ''
  135. },
  136. // 按钮图标
  137. icon: {
  138. type: String,
  139. default: ''
  140. },
  141. // 按钮图标大小
  142. iconSize: {
  143. type: [String, Number],
  144. default: ''
  145. },
  146. // 按钮图标颜色
  147. iconColor: {
  148. type: String,
  149. default: '#000000'
  150. },
  151. // 按钮颜色,支持传入linear-gradient渐变色
  152. color: {
  153. type: String,
  154. default: ''
  155. },
  156. // 自定义按钮文本样式
  157. customTextStyle: {
  158. type: [Object,String],
  159. default: ''
  160. },
  161. ...uni.$uv?.props?.button
  162. }
  163. }