vue使用mint实现右划删除

news/2024/7/10 2:43:26 标签: vue, cell-swipe

template:

<template>
    <div class="sLocation">
        <mt-cell-swipe :right="[{
                    content: '删除',
                    style: { background: '#f66', color: '#fff' },
                    handler: () => unfollow(item)
                    }]" v-for="item in 10" :key="item">
            <div class="lists">
                <div class="locationcontent">
                    <div>
                        <span>收货人:张三</span>
                        <span style="color: #777;">15700728284</span>
                    </div>
                    <div>
                        <span>收货地址:</span>
                        <span>asddddddddddddddddddd</span>
                    </div>
                </div>
            </div>
        </mt-cell-swipe>
        <div class="popup" @click="push()">
            <span>新增收货地址</span>
        </div>
    </div>
</template>

script:

<script>
    import {
        Toast,
        Indicator
    } from 'mint-ui';
    export default {
        created() {
            this.$store.dispatch("newTitle","新增收货地址")
        },
        data: () => ({}),
        methods: {
            push() {
                this.$router.push({
                    path: "/sLocation/sLocationInfo"
                })
            },
            // 取消关注 通过v-for循环
            unfollow(id) {
                Indicator.open();
                // console.log(id);
                this.$http.post(this.root + "FollowApp", {
                    gId: id
                }, {
                    emulateJSON: true
                }).then((res) => {
                    if (res.body.code === 0) {
                        Indicator.close();
                        Toast({
                            message: "您已取消关注",
                            position: 'center',
                            duration: 3000
                        });
                        this.getServersList()
                    } else {}
                }, (err) => {})
            },
        }
    }
</script>

style:

<style lang="less">
    .mint-cell {
        margin-left: 5px;
        margin-bottom: 10px !important;
        border-bottom-left-radius: 5px
    }
    .sLocation {
        width: 100%;
        height: 100%;
        background: #eee;
        padding-top: 15px;
        position: relative;
        .popup {
            position: fixed;
            bottom: 0;
            width: 100%;
            background: #39c;
            height: 40px;
            line-height: 40px;
            color: #fff;
            text-align: center;
        }
        .mint-cell-value {
            width: 100%;
            color: #333;
        }
        .mint-cell-wrapper {
            padding: 0;
        }
        .mint-cell {
            margin-bottom: 6px;
            background-size: 10% 0;
        }
        .lists {
            position: relative;
            width: 100%;
            height: 100px;
            padding: 0 9px;
            background: #fff;
            margin-bottom: 5px;
            .locationcontent {
                div {
                    &:first-child {
                        padding: 20px 0;
                        position: relative;
                        span {
                            display: inline-block;
                            &:first-child {
                                width: 120px;
                            }
                            &:last-child {
                                position: absolute;
                                right: 0;
                            }
                        }
                    }
                }
            }
            .deal {
                position: absolute;
                bottom: 0;
                right: 0;
                width: 64px;
                height: 65px;
            }
            h3 {
                position: relative;
                height: 40px;
                line-height: 40px;
                padding-left: 50px;
                font-size: 16px;
                font-weight: 400;
                /* prettier-ignore */
                border-bottom: #ccc 1PX solid;
                .cai {
                    position: absolute;
                    top: 50%;
                    left: 15px;
                    transform: translateY(-50%);
                    width: 25px;
                    height: 25px;
                    line-height: 25px;
                    font-size: 16px;
                    text-align: center;
                    color: #fff;
                    background: #3399cc;
                }
                .nmb,
                .nmb1 {
                    position: absolute;
                    top: 50%;
                    right: 60px;
                    transform: translateY(-50%);
                    color: red;
                }
                .nmb1 {
                    right: 15px;
                    color: #000;
                }
            }
        }
        .mint-cell-swipe-buttongroup {
            overflow: hidden;
            .mint-cell-swipe-button {
                box-sizing: border-box;
                padding: 40px 20px 0 20px;
                line-height: normal;
                font-size: 15px;
            }
        }
    }
</style>

http://www.niftyadmin.cn/n/1834460.html

相关文章

Linux服务器监控脚本

Linux性能监控脚本一 资源性能监控1 系统负载2 CPU空间3 内存、交换分区4 磁盘空间5 用户性能数据记录 超过警告值报警通知Linux性能监控脚本 /usr/monitor/performance.sh Linux性能监控日志 /usr/monitor/performance/performance_%Y%m%d.log二 进程服务监控1 apache2 mysql3…

在C++中的ODBC API数据库编程

在C中的ODBC API数据库编程 一、动态加载数据源 1、通过修改注册表加载数据源&#xff1a; 用户数据源&#xff1a;HKEY_CURRENT_USER&#xff3c;SOFTWARE&#xff3c;ODBC&#xff3c;ODBC.INI系统数据源&#xff1a;HKEY_LOCAL_MACHINE&#xff3c;SOFTWARE&#xff3c;ODBC…

vue结合android,mint中popup和picker实现省市区三级联动

template: //触发事件 <div :class"{borBm: borBm 4}"><span>通讯住址&#xff1a;</span><span v-if"countyName && countyName ! [请选择]" click"showPopup(1)">{{provinceName}}-{{cityName}}-{{countyNa…

hdu 1070 Milk

虽然是水题&#xff0c;还是由于看题不细wa了几次。 1 #include <iostream>2 #include <cstdio>3 #include <string>4 #include <vector>5 #include <algorithm>6 using namespace std;7 const int everyday_v 200;8 const int drinkday 5;9 s…

QTP

一、下载软件 1、 从Mercury公司网站下载软件 2、 下载地址&#xff1a;http://esd.mercury.com/akdlm/trial/qtp/qtp92.zip 3、 文件大小&#xff1a;417 MB (438,164,273 字节) 二、安装qtp 1、 当出现界面“许可证类型”时候&#xff0c; 选择“单机版&#xff1a;请使用…

【转载】详解iPhone文件读写系统操作教程

1&#xff1a;原文摘自&#xff1a;http://mobile.51cto.com/iphone-282233.htmiPhone文件读写系统操作教程是本文要介绍的内容&#xff0c;对于一个运行在iPhone得app,它只能访问自己根目录下得一些文件&#xff08;所谓sandbox).一个app发布到iPhone上后&#xff0c;它得目录…

【C语言】深入学习函数(万字)

&#x1f466;个人主页&#xff1a;Weraphael ✍&#x1f3fb;作者简介&#xff1a;目前正在回炉重造C语言&#xff08;2023暑假&#xff09; ✈️专栏&#xff1a;【C语言航路】 &#x1f40b; 希望大家多多支持&#xff0c;咱一起进步&#xff01;&#x1f601; 如果文章对你…

word中加上划线的方法

转载于:https://www.cnblogs.com/uvw654/archive/2013/03/17/2964232.html