Vue 使用 Mint UI 实现左滑删除效果CellSwipe

作者:小白菜的博客 时间:2024-05-10 14:16:45 

Mint UI 是饿了么开源的,基于 Vue.js 的移动端组件库。

关于Mint UI,有文档不够准确详尽,组件略显粗糙,功能不够完善等问题;也有高度组件化,体积小等优点。

安装Mint UI:


# Vue 1.x
npm install mint-ui@1 -S
# Vue 2.0
npm install mint-ui -S

引入组件:


// 引入全部组件
import Mint from 'mint-ui';
import 'mint-ui/lib/style.css'
Vue.use(Mint);
// 按需引入部分组件
import { CellSwipe } from 'mint-ui';
Vue.component(CellSwipe.name, CellSwipe);

从文档中摘录API,Slot如下:

Vue 使用 Mint UI 实现左滑删除效果CellSwipe

代码示例:


<ul class="list">
<li class="item" v-for="section in sectionList">
 <mt-cell-swipe
  :right="[
   {
    content: '删除',
    style: { background: '#ff7900', color: '#fff'},
    handler: () => deleteSection(section.PartId)
   }
  ]">
  <p class="section">{{section.PartName}}</p>
  <p class="teacher">{{section.TeacherName}}</p>
 </mt-cell-swipe>
</li>
</ul>

:right可以定义不止一个按钮,也可以自行修改CellSwipe的默认样式

效果展示:

Vue 使用 Mint UI 实现左滑删除效果CellSwipe 

总结

以上所述是小编给大家介绍的Vue 使用 Mint UI 实现左滑删除效果CellSwipe网站的支持!

来源:https://blog.csdn.net/qq_32963841/article/details/80103227

标签:vue,Mint,UI,左滑删除
0
投稿

猜你喜欢

  • python中复数的共轭复数知识点总结

    2023-09-18 14:11:07
  • Python使用scipy保存图片的一些注意点

    2023-12-01 06:06:58
  • jQuery中$.ajax的实现解析

    2008-07-20 13:11:00
  • Python 如何展开嵌套的序列

    2022-10-12 03:15:37
  • 如何正确使用开源项目?

    2023-01-29 22:14:57
  • 使用JavaScript脚本无法直接改变Asp.net中Checkbox控件的Enable属性的解决方法

    2024-05-03 15:06:27
  • hive中将string数据转为bigint的操作

    2024-01-20 15:37:18
  • js实现GIF动图分解成多帧图片上传

    2023-08-15 00:06:38
  • [组图]手把手教你制作ASP留言本

    2007-09-22 09:32:00
  • Python groupby函数图文详解

    2021-10-01 06:17:09
  • Django框架下在URLconf中指定视图缓存的方法

    2023-10-03 01:54:28
  • Python 中的lambda匿名函数和三元运算符

    2023-04-21 05:22:18
  • python编程测试电脑开启最大线程数实例代码

    2023-07-07 12:19:46
  • Python机器学习NLP自然语言处理基本操作词向量模型

    2022-01-16 10:33:42
  • Python中Json使用示例详解

    2021-01-17 00:43:43
  • vue、react等单页面项目部署到服务器的方法及vue和react的区别

    2024-04-30 10:30:00
  • css学习笔记:DIV水平垂直居中

    2009-06-19 12:45:00
  • python执行使用shell命令方法分享

    2022-03-30 01:02:18
  • 一文搞懂Vue3中的异步组件defineAsyncComponentAPI的用法

    2024-04-29 13:09:08
  • python中的集合及集合常用的使用方法

    2023-05-04 11:14:11
  • asp之家 网络编程 m.aspxhome.com