This time I will show you how to operate Vue and use Mint UI to achieve left-swipe deletion. Delete Effect CellSwipe. How to operate Vue and use Mint UI to achieve left-swipe deletion effect of CellSwipe. What are the precautions , the following is a practical case, let’s take a look.
Mint UI is an open source mobile component library based on Vue.js.
Regarding Mint UI, there are problems such as the documentation is not accurate and detailed enough, the components are slightly rough, and the functions are not perfect enough. It also has the advantages of being highly componentized and small in size.
InstallationMint UI:
# Vue 1.x npm install mint-ui@1 -S # Vue 2.0 npm install mint-ui -S
Introduction of components:
// 引入全部组件 import Mint from 'mint-ui'; import 'mint-ui/lib/style.css' Vue.use(Mint); // 按需引入部分组件 import { CellSwipe } from 'mint-ui'; Vue.component(CellSwipe.name, CellSwipe);
Extract the API from the document, the Slot is as follows:
Code example:
<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 can define more than one button, or you can modify CellSwipe's default style
Effect display:
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
How to use React native ListView to add top pull-down refresh and bottom click refresh
How to use Vue2. 0Call the camera to take pictures
The above is the detailed content of How to operate Vue and use Mint UI to achieve left-swipe deletion effect CellSwipe. For more information, please follow other related articles on the PHP Chinese website!