props.js 5.5 KB

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