1
0

u-button.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. <template>
  2. <button
  3. id="u-wave-btn"
  4. class="u-btn u-line-1 u-fix-ios-appearance"
  5. :class="[
  6. 'u-size-' + size,
  7. plain ? 'u-btn--' + type + '--plain' : '',
  8. loading ? 'u-loading' : '',
  9. shape == 'circle' ? 'u-round-circle' : '',
  10. hairLine ? showHairLineBorder : 'u-btn--bold-border',
  11. 'u-btn--' + type,
  12. disabled ? `u-btn--${type}--disabled` : '',
  13. ]"
  14. :hover-start-time="Number(hoverStartTime)"
  15. :hover-stay-time="Number(hoverStayTime)"
  16. :disabled="disabled"
  17. :form-type="formType"
  18. :open-type="openType"
  19. :app-parameter="appParameter"
  20. :hover-stop-propagation="hoverStopPropagation"
  21. :send-message-title="sendMessageTitle"
  22. send-message-path="sendMessagePath"
  23. :lang="lang"
  24. :data-name="dataName"
  25. :session-from="sessionFrom"
  26. :send-message-img="sendMessageImg"
  27. :show-message-card="showMessageCard"
  28. @getphonenumber="getphonenumber"
  29. @getuserinfo="getuserinfo"
  30. @error="error"
  31. @opensetting="opensetting"
  32. @launchapp="launchapp"
  33. @chooseavatar="chooseavatar"
  34. :style="[customStyle, {
  35. overflow: ripple ? 'hidden' : 'visible'
  36. }]"
  37. @tap.stop="click($event)"
  38. :hover-class="getHoverClass"
  39. :loading="loading"
  40. >
  41. <slot></slot>
  42. <view
  43. v-if="ripple"
  44. class="u-wave-ripple"
  45. :class="[waveActive ? 'u-wave-active' : '']"
  46. :style="{
  47. top: rippleTop + 'px',
  48. left: rippleLeft + 'px',
  49. width: fields.targetWidth + 'px',
  50. height: fields.targetWidth + 'px',
  51. 'background-color': rippleBgColor || 'rgba(0, 0, 0, 0.15)'
  52. }"
  53. ></view>
  54. </button>
  55. </template>
  56. <script>
  57. /**
  58. * button 按钮
  59. * @description Button 按钮
  60. * @tutorial https://www.uviewui.com/components/button.html
  61. * @property {String} size 按钮的大小
  62. * @value large 大
  63. * @value normal 常规
  64. * @value mini 小
  65. * @property {Boolean} ripple 是否开启点击水波纹效果
  66. * @property {String} ripple-bg-color 水波纹的背景色,ripple为true时有效
  67. * @property {String} type 按钮的样式类型
  68. * @value info 默认按钮
  69. * @value primary 主要按钮
  70. * @value error 危险按钮
  71. * @value warning 警告按钮
  72. * @value success 成功按钮
  73. * @property {Boolean} plain 按钮是否镂空,背景色透明
  74. * @property {Boolean} disabled 是否禁用
  75. * @property {Boolean} hair-line 是否显示按钮的细边框(默认true)
  76. * @property {Boolean} shape 按钮外观形状,见文档说明
  77. * @value square 矩形
  78. * @value circle 圆角
  79. * @property {Boolean} loading 按钮名称前是否带 loading 图标(App-nvue 平台,在 ios 上为雪花,Android上为圆圈)
  80. * @property {String} form-type 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
  81. * @property {String} openType 开放能力
  82. * @value feedback 通用 - 打开“意见反馈”页面,用户可提交反馈内容并上传日志(App、微信小程序、QQ小程序)
  83. * @value share 通用 - 触发用户转发(微信小程序、百度小程序、支付宝小程序、字节跳动小程序、飞书小程序、QQ小程序、快手小程序、京东小程序、360小程序)
  84. * @value getUserInfo 通用 - 获取用户信息(微信小程序、百度小程序、QQ小程序、快手小程序、京东小程序、360小程序)
  85. * @value contact 通用 - 打开客服会话,如果用户在会话中点击消息卡片后返回应用,可以从 回调中获得具体信息(微信小程序、百度小程序、快手小程序、字节小程序)
  86. * @value getPhoneNumber 通用 - 获取用户手机号(微信小程序、百度小程序、字节跳动小程序、支付宝小程序、快手小程序、京东小程序。App平台另见一键登陆)
  87. * @value launchApp 通用 - 小程序中打开APP,可以通过app-parameter属性设定向APP传的参数 (微信小程序、QQ小程序、快手小程序、京东小程序)
  88. * @value openSetting 通用 - 打开授权设置页(微信小程序、QQ小程序、百度小程序、快手小程序、京东小程序、360小程序)
  89. * @value chooseAvatar 微信小程序 - 获取用户头像
  90. * @value uploadDouyinVideo 抖音小程序 - 发布抖音视频
  91. * @value im 抖音小程序 - 跳转到抖音IM客服
  92. * @value getAuthorize 支付宝小程序 - 授权
  93. * @value lifestyle 支付宝小程序 - 关注生活号
  94. * @value contactShare 支付宝小程序 - 分享到通讯录好友
  95. * @value openGroupProfile QQ小程序 - 呼起QQ群资料卡页面,可以通过group-id属性设定需要打开的群资料卡的群号,同时manifest.json中必须配置groupIdList
  96. * @value openGuildProfile QQ小程序 - 呼起频道页面,可以通过guild-id属性设定需要打开的频道ID
  97. * @value openPublicProfile QQ小程序 - 打开公众号资料卡,可以通过public-id属性设定需要打开的公众号资料卡的号码,同时manifest.json中必须配置publicIdList
  98. * @value shareMessageToFriend QQ小程序 - 在自定义开放数据域组件中,向指定好友发起分享据
  99. * @value addFriend QQ小程序 - 添加好友, 对方需要通过该小程序进行授权,允许被加好友后才能调用成功用户授权
  100. * @value addColorSign QQ小程序 - 添加彩签,点击后添加状态有用户提示,无回调
  101. * @value addGroupApp QQ小程序 - 添加群应用(只有管理员或群主有权操作),添加后给button绑定@addgroupapp事件接收回调数据
  102. * @value addToFavorites QQ小程序 - 收藏当前页面,点击按钮后会触发Page.onAddToFavorites方法
  103. * @value chooseAddress 百度小程序 - 选择用户收货地址
  104. * @value chooseInvoiceTitle 百度小程序 - 选择用户发票抬头
  105. * @value login 百度小程序 - 登录,可以从@login回调中确认是否登录成功
  106. * @value subscribe 百度小程序 - 订阅类模板消息,需要用户授权才可发送
  107. * @value favorite 快手小程序 - 触发用户收藏
  108. * @value watchLater 快手小程序 - 触发用户稍后再看
  109. * @value openProfile 快手小程序 - 触发打开用户主页
  110. * @property {String} data-name 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
  111. * @property {String} hover-class 指定按钮按下去的样式类。当 hover-class="none" 时,没有点击态效果(App-nvue 平台暂不支持)
  112. * @property {Number} hover-start-time 按住后多久出现点击态,单位毫秒
  113. * @property {Number} hover-stay-time 手指松开后点击态保留时间,单位毫秒
  114. * @property {Object} custom-style 对按钮的自定义样式,对象形式,见文档说明
  115. * @event {Function} click 按钮点击
  116. * @event {Function} getphonenumber open-type="getPhoneNumber"时有效
  117. * @event {Function} getuserinfo 用户点击该按钮时,会返回获取到的用户信息,从返回参数的detail中获取到的值同uni.getUserInfo
  118. * @event {Function} error 当使用开放能力时,发生错误的回调
  119. * @event {Function} opensetting 在打开授权设置页并关闭后回调
  120. * @event {Function} launchapp 打开 APP 成功的回调
  121. * @event {Function} chooseavatar 获取用户头像,可以从@chooseavatar回调中获取到头像信息,open-type="chooseAvatar"时有效
  122. * @example <u-button>月落</u-button>
  123. */
  124. export default {
  125. name: 'u-button',
  126. emits: ["click", "getphonenumber", "getuserinfo", "error", "opensetting", "launchapp", "chooseavatar"],
  127. props: {
  128. // 是否细边框
  129. hairLine: {
  130. type: Boolean,
  131. default: true
  132. },
  133. // 按钮的预置样式,default,primary,error,warning,success
  134. type: {
  135. type: String,
  136. default: 'default'
  137. },
  138. // 按钮尺寸,default,medium,mini
  139. size: {
  140. type: String,
  141. default: 'default'
  142. },
  143. // 按钮形状,circle(两边为半圆),square(带圆角)
  144. shape: {
  145. type: String,
  146. default: 'square'
  147. },
  148. // 按钮是否镂空
  149. plain: {
  150. type: Boolean,
  151. default: false
  152. },
  153. // 是否禁止状态
  154. disabled: {
  155. type: Boolean,
  156. default: false
  157. },
  158. // 是否加载中
  159. loading: {
  160. type: Boolean,
  161. default: false
  162. },
  163. // 开放能力,具体请看uniapp稳定关于button组件部分说明
  164. // https://uniapp.dcloud.io/component/button
  165. openType: {
  166. type: String,
  167. default: ''
  168. },
  169. // 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
  170. // 取值为submit(提交表单),reset(重置表单)
  171. formType: {
  172. type: String,
  173. default: ''
  174. },
  175. // 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
  176. // 只微信小程序、QQ小程序有效
  177. appParameter: {
  178. type: String,
  179. default: ''
  180. },
  181. // 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
  182. hoverStopPropagation: {
  183. type: Boolean,
  184. default: false
  185. },
  186. // 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效
  187. lang: {
  188. type: String,
  189. default: 'en'
  190. },
  191. // 会话来源,open-type="contact"时有效。只微信小程序有效
  192. sessionFrom: {
  193. type: String,
  194. default: ''
  195. },
  196. // 会话内消息卡片标题,open-type="contact"时有效
  197. // 默认当前标题,只微信小程序有效
  198. sendMessageTitle: {
  199. type: String,
  200. default: ''
  201. },
  202. // 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效
  203. // 默认当前分享路径,只微信小程序有效
  204. sendMessagePath: {
  205. type: String,
  206. default: ''
  207. },
  208. // 会话内消息卡片图片,open-type="contact"时有效
  209. // 默认当前页面截图,只微信小程序有效
  210. sendMessageImg: {
  211. type: String,
  212. default: ''
  213. },
  214. // 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,
  215. // 用户点击后可以快速发送小程序消息,open-type="contact"时有效
  216. showMessageCard: {
  217. type: Boolean,
  218. default: false
  219. },
  220. // 手指按(触摸)按钮时按钮时的背景颜色
  221. hoverBgColor: {
  222. type: String,
  223. default: ''
  224. },
  225. // 水波纹的背景颜色
  226. rippleBgColor: {
  227. type: String,
  228. default: ''
  229. },
  230. // 是否开启水波纹效果
  231. ripple: {
  232. type: Boolean,
  233. default: false
  234. },
  235. // 按下的类名
  236. hoverClass: {
  237. type: String,
  238. default: ''
  239. },
  240. // 自定义样式,对象形式
  241. customStyle: {
  242. type: Object,
  243. default() {
  244. return {};
  245. }
  246. },
  247. // 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
  248. dataName: {
  249. type: String,
  250. default: ''
  251. },
  252. // 节流,一定时间内只能触发一次
  253. throttleTime: {
  254. type: [String, Number],
  255. default: 500
  256. },
  257. // 按住后多久出现点击态,单位毫秒
  258. hoverStartTime: {
  259. type: [String, Number],
  260. default: 20
  261. },
  262. // 手指松开后点击态保留时间,单位毫秒
  263. hoverStayTime: {
  264. type: [String, Number],
  265. default: 150
  266. },
  267. timerId: {
  268. type: [String, Number]
  269. },
  270. },
  271. computed: {
  272. // 当没有传bgColor变量时,按钮按下去的颜色类名
  273. getHoverClass() {
  274. // 如果开启水波纹效果,则不启用hover-class效果
  275. if (this.loading || this.disabled || this.ripple || this.hoverClass) return '';
  276. let hoverClass = '';
  277. hoverClass = this.plain ? 'u-' + this.type + '-plain-hover' : 'u-' + this.type + '-hover';
  278. return hoverClass;
  279. },
  280. // 在'primary', 'success', 'error', 'warning'类型下,不显示边框,否则会造成四角有毛刺现象
  281. showHairLineBorder() {
  282. if (['primary', 'success', 'error', 'warning'].indexOf(this.type) >= 0 && !this.plain) {
  283. return '';
  284. } else {
  285. return 'u-hairline-border';
  286. }
  287. }
  288. },
  289. data() {
  290. let btnTimerId = this.timerId || "button_" + Math.floor(Math.random() * 100000000 + 0);
  291. return {
  292. btnTimerId,
  293. rippleTop: 0, // 水波纹的起点Y坐标到按钮上边界的距离
  294. rippleLeft: 0, // 水波纹起点X坐标到按钮左边界的距离
  295. fields: {}, // 波纹按钮节点信息
  296. waveActive: false // 激活水波纹
  297. };
  298. },
  299. methods: {
  300. // 按钮点击
  301. click(e) {
  302. // 进行节流控制,每this.throttle毫秒内,只在开始处执行
  303. this.$u.throttle(() => {
  304. // 如果按钮时disabled和loading状态,不触发水波纹效果
  305. if (this.loading === true || this.disabled === true) return;
  306. // 是否开启水波纹效果
  307. if (this.ripple) {
  308. // 每次点击时,移除上一次的类,再次添加,才能触发动画效果
  309. this.waveActive = false;
  310. this.$nextTick(function() {
  311. this.getWaveQuery(e);
  312. });
  313. }
  314. this.$emit('click', e);
  315. }, this.throttleTime, true, this.btnTimerId);
  316. },
  317. // 查询按钮的节点信息
  318. getWaveQuery(e) {
  319. this.getElQuery().then(res => {
  320. // 查询返回的是一个数组节点
  321. let data = res[0];
  322. // 查询不到节点信息,不操作
  323. if (!data.width || !data.width) return;
  324. // 水波纹的最终形态是一个正方形(通过border-radius让其变为一个圆形),这里要保证正方形的边长等于按钮的最长边
  325. // 最终的方形(变换后的圆形)才能覆盖整个按钮
  326. data.targetWidth = data.height > data.width ? data.height : data.width;
  327. if (!data.targetWidth) return;
  328. this.fields = data;
  329. let touchesX = '',
  330. touchesY = '';
  331. // #ifdef MP-BAIDU
  332. touchesX = e.changedTouches[0].clientX;
  333. touchesY = e.changedTouches[0].clientY;
  334. // #endif
  335. // #ifdef MP-ALIPAY
  336. touchesX = e.detail.clientX;
  337. touchesY = e.detail.clientY;
  338. // #endif
  339. // #ifndef MP-BAIDU || MP-ALIPAY
  340. touchesX = e.touches[0].clientX;
  341. touchesY = e.touches[0].clientY;
  342. // #endif
  343. // 获取触摸点相对于按钮上边和左边的x和y坐标,原理是通过屏幕的触摸点(touchesY),减去按钮的上边界data.top
  344. // 但是由于`transform-origin`默认是center,所以这里再减去半径才是水波纹view应该的位置
  345. // 总的来说,就是把水波纹的矩形(变换后的圆形)的中心点,移动到我们的触摸点位置
  346. this.rippleTop = touchesY - data.top - data.targetWidth / 2;
  347. this.rippleLeft = touchesX - data.left - data.targetWidth / 2;
  348. this.$nextTick(() => {
  349. this.waveActive = true;
  350. });
  351. });
  352. },
  353. // 获取节点信息
  354. getElQuery() {
  355. return new Promise(resolve => {
  356. let queryInfo = '';
  357. // 获取元素节点信息,请查看uniapp相关文档
  358. // https://uniapp.dcloud.io/api/ui/nodes-info?id=nodesrefboundingclientrect
  359. queryInfo = uni.createSelectorQuery().in(this);
  360. //#ifdef MP-ALIPAY
  361. queryInfo = uni.createSelectorQuery();
  362. //#endif
  363. queryInfo.select('.u-btn').boundingClientRect();
  364. queryInfo.exec(data => {
  365. resolve(data);
  366. });
  367. });
  368. },
  369. // 下面为对接uniapp官方按钮开放能力事件回调的对接
  370. getphonenumber(res) {
  371. this.$emit('getphonenumber', res);
  372. },
  373. getuserinfo(res) {
  374. this.$emit('getuserinfo', res);
  375. },
  376. error(res) {
  377. this.$emit('error', res);
  378. },
  379. opensetting(res) {
  380. this.$emit('opensetting', res);
  381. },
  382. launchapp(res) {
  383. this.$emit('launchapp', res);
  384. },
  385. chooseavatar(res) {
  386. this.$emit('chooseavatar', res);
  387. }
  388. }
  389. };
  390. </script>
  391. <style scoped lang="scss">
  392. @import '../../libs/css/style.components.scss';
  393. .u-btn::after {
  394. border: none;
  395. }
  396. .u-btn {
  397. position: relative;
  398. border: 0;
  399. //border-radius: 10rpx;
  400. /* #ifndef APP-NVUE */
  401. display: inline-flex;
  402. /* #endif */
  403. // 避免边框某些场景可能被“裁剪”,不能设置为hidden
  404. overflow: visible;
  405. line-height: 1;
  406. @include vue-flex;
  407. align-items: center;
  408. justify-content: center;
  409. cursor: pointer;
  410. padding: 0 40rpx;
  411. z-index: 1;
  412. box-sizing: border-box;
  413. transition: all 0.15s;
  414. &--bold-border {
  415. border: 1px solid #ffffff;
  416. }
  417. &--default {
  418. color: $u-content-color;
  419. border-color: #c0c4cc;
  420. background-color: #ffffff;
  421. }
  422. &--primary {
  423. color: #ffffff;
  424. border-color: $u-type-primary;
  425. background-color: $u-type-primary;
  426. }
  427. &--success {
  428. color: #ffffff;
  429. border-color: $u-type-success;
  430. background-color: $u-type-success;
  431. }
  432. &--error {
  433. color: #ffffff;
  434. border-color: $u-type-error;
  435. background-color: $u-type-error;
  436. }
  437. &--warning {
  438. color: #ffffff;
  439. border-color: $u-type-warning;
  440. background-color: $u-type-warning;
  441. }
  442. &--default--disabled {
  443. color: #ffffff;
  444. border-color: #e4e7ed;
  445. background-color: #ffffff;
  446. }
  447. &--primary--disabled {
  448. color: #ffffff!important;
  449. border-color: $u-type-primary-disabled!important;
  450. background-color: $u-type-primary-disabled!important;
  451. }
  452. &--success--disabled {
  453. color: #ffffff!important;
  454. border-color: $u-type-success-disabled!important;
  455. background-color: $u-type-success-disabled!important;
  456. }
  457. &--error--disabled {
  458. color: #ffffff!important;
  459. border-color: $u-type-error-disabled!important;
  460. background-color: $u-type-error-disabled!important;
  461. }
  462. &--warning--disabled {
  463. color: #ffffff!important;
  464. border-color: $u-type-warning-disabled!important;
  465. background-color: $u-type-warning-disabled!important;
  466. }
  467. &--primary--plain {
  468. color: $u-type-primary!important;
  469. border-color: $u-type-primary-disabled!important;
  470. background-color: $u-type-primary-light!important;
  471. }
  472. &--success--plain {
  473. color: $u-type-success!important;
  474. border-color: $u-type-success-disabled!important;
  475. background-color: $u-type-success-light!important;
  476. }
  477. &--error--plain {
  478. color: $u-type-error!important;
  479. border-color: $u-type-error-disabled!important;
  480. background-color: $u-type-error-light!important;
  481. }
  482. &--warning--plain {
  483. color: $u-type-warning!important;
  484. border-color: $u-type-warning-disabled!important;
  485. background-color: $u-type-warning-light!important;
  486. }
  487. &--info {
  488. color: #ffffff;
  489. border-color: $u-type-info;
  490. background-color: $u-type-info;
  491. }
  492. &--info--disabled {
  493. color: #ffffff!important;
  494. border-color: $u-type-info-disabled!important;
  495. background-color: $u-type-info-disabled!important;
  496. }
  497. &--info--plain {
  498. color: $u-type-info!important;
  499. border-color: $u-type-info-disabled!important;
  500. background-color: $u-type-info-light!important;
  501. }
  502. }
  503. .u-hairline-border:after {
  504. content: ' ';
  505. position: absolute;
  506. pointer-events: none;
  507. // 设置为border-box,意味着下面的scale缩小为0.5,实际上缩小的是伪元素的内容(border-box意味着内容不含border)
  508. box-sizing: border-box;
  509. // 中心点作为变形(scale())的原点
  510. -webkit-transform-origin: 0 0;
  511. transform-origin: 0 0;
  512. left: 0;
  513. top: 0;
  514. width: 199.8%;
  515. height: 199.7%;
  516. -webkit-transform: scale(0.5, 0.5);
  517. transform: scale(0.5, 0.5);
  518. border: 1px solid currentColor;
  519. z-index: 1;
  520. }
  521. .u-wave-ripple {
  522. z-index: 0;
  523. position: absolute;
  524. border-radius: 100%;
  525. background-clip: padding-box;
  526. pointer-events: none;
  527. user-select: none;
  528. transform: scale(0);
  529. opacity: 1;
  530. transform-origin: center;
  531. }
  532. .u-wave-ripple.u-wave-active {
  533. opacity: 0;
  534. transform: scale(2);
  535. transition: opacity 1s linear, transform 0.4s linear;
  536. }
  537. .u-round-circle {
  538. border-radius: 100rpx;
  539. }
  540. .u-round-circle::after {
  541. border-radius: 100rpx;
  542. }
  543. .u-loading::after {
  544. background-color: hsla(0, 0%, 100%, 0.35);
  545. }
  546. .u-size-default {
  547. font-size: 30rpx;
  548. height: 80rpx;
  549. line-height: 80rpx;
  550. }
  551. .u-size-medium {
  552. /* #ifndef APP-NVUE */
  553. display: inline-flex;
  554. /* #endif */
  555. width: auto;
  556. font-size: 26rpx;
  557. height: 70rpx;
  558. line-height: 70rpx;
  559. padding: 0 80rpx;
  560. }
  561. .u-size-mini {
  562. /* #ifndef APP-NVUE */
  563. display: inline-flex;
  564. /* #endif */
  565. width: auto;
  566. font-size: 22rpx;
  567. padding-top: 1px;
  568. height: 50rpx;
  569. line-height: 50rpx;
  570. padding: 0 20rpx;
  571. }
  572. .u-primary-plain-hover {
  573. color: #ffffff !important;
  574. background: $u-type-primary-dark !important;
  575. }
  576. .u-default-plain-hover {
  577. color: $u-type-primary-dark !important;
  578. background: $u-type-primary-light !important;
  579. }
  580. .u-success-plain-hover {
  581. color: #ffffff !important;
  582. background: $u-type-success-dark !important;
  583. }
  584. .u-warning-plain-hover {
  585. color: #ffffff !important;
  586. background: $u-type-warning-dark !important;
  587. }
  588. .u-error-plain-hover {
  589. color: #ffffff !important;
  590. background: $u-type-error-dark !important;
  591. }
  592. .u-info-plain-hover {
  593. color: #ffffff !important;
  594. background: $u-type-info-dark !important;
  595. }
  596. .u-default-hover {
  597. color: $u-type-primary-dark !important;
  598. border-color: $u-type-primary-dark !important;
  599. background-color: $u-type-primary-light !important;
  600. }
  601. .u-primary-hover {
  602. background: $u-type-primary-dark !important;
  603. color: #fff;
  604. }
  605. .u-success-hover {
  606. background: $u-type-success-dark !important;
  607. color: #fff;
  608. }
  609. .u-info-hover {
  610. background: $u-type-info-dark !important;
  611. color: #fff;
  612. }
  613. .u-warning-hover {
  614. background: $u-type-warning-dark !important;
  615. color: #fff;
  616. }
  617. .u-error-hover {
  618. background: $u-type-error-dark !important;
  619. color: #fff;
  620. }
  621. </style>