数据动态添加和取消,以及排序

本文介绍了一个使用Vue.js实现的功能:通过点击箭头在左右两个框间动态添加和删除字段,并且已选字段能通过按钮进行上下排序。项目依赖于bootstrap-vue库,通过npm安装并引入Vue和Bootstrap-Vue实现组件功能。
摘要由CSDN通过智能技术生成

在这里插入图片描述
需求描述:
1.左右两个框里的字段选中后点击箭头可以添加到对侧框里,被选中的框里相应的字段删除;
2.已经选好的list点击上下button 能够进行选中的字段上下排序;

项目依赖使用了 bootstrap-vue https://bootstrap-vue.js.org;
安装
npm install vue bootstrap-vue bootstrap

npm install vue bootstrap-vue

引用
import Vue from ‘vue’
import BootstrapVue from ‘bootstrap-vue’

Vue.use(BootstrapVue)
ok,直接上vue 组件


<template>
    <div style="width: 90%;margin:10px auto ;">
        <b-button pill variant="primary" size="sm" @click="fieldCustom">
           点击
        </b-button>
        <b-modal id="custom-modal" ref="customodal" scrollable size="lg" title="Custom Table Fields">
            <b-container fluid>
                <b-row style="padding: 1rem 1rem 0rem 1rem;" class="justify-content-sm-center">
                    <b-col sm="5">
                        <h6>All fields</h6>
                    </b-col>
                    <b-col sm="1"></b-col>
                    <b-col sm="5">
                        <h6>Selected fields to display</h6>
                    </b-col>
                </b-row>
                <b-row style="padding: 0rem 1rem
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值