Home > Web Front-end > JS Tutorial > body text

Vue+Mint UI makes sliding deletion on mobile phone

php中世界最好的语言
Release: 2018-06-04 15:02:47
Original
2412 people have browsed it

This time I will bring you Vue Mint UI to make sliding deletion on the mobile phoneDelete, what are the precautions for Vue Mint UI to make sliding deletion on the mobile phone, the following is a practical case , let’s take a look.

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
Copy after login

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);
Copy after login

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: &#39;删除&#39;, 
     style: { background: &#39;#ff7900&#39;, color: &#39;#fff&#39;}, 
     handler: () => deleteSection(section.PartId) 
    } 
   ]"> 
   <p class="section">{{section.PartName}}</p> 
   <p class="teacher">{{section.TeacherName}}</p> 
  </mt-cell-swipe> 
 </li> 
</ul>
Copy after login

: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 generate random data with mockjs

Using post request in vue (with code)

The above is the detailed content of Vue+Mint UI makes sliding deletion on mobile phone. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template