• 界面拖动界面拖动


    formDesigner: 基于vue+ElementUI的表单设计器,让表单拖拽更加简单方便。想做功能最全的表单设计器

    import Vue from 'vue'
    import App from './App'
    import ElementUI from 'element-ui';
    import 'element-ui/lib/theme-chalk/index.css';
    import router from './router'

    Vue.use(ElementUI);
    Vue.config.productionTip = false

    /* eslint-disable no-new */
    new Vue({
      el: '#app',
      router,
      components: { App },
      template: '<App/>'
    })

    <template>
      <div id="app">
        <img src="./assets/logo.png">
         <el-card class="box-card leftCard">
          <vuedraggable v-model="list" :sort="false"  :group="{ name: 'course', pull: 'clone' }">
            <div v-for="item in list" :key="item" class="item"><el-button>{{ item }}</el-button></div>
          </vuedraggable>
        </el-card>
        <el-card class="box-card leftCard">
          <vuedraggable v-model="list2"   :group="{ name: 'course', pull: 'clone' }">
            <div v-for="item in list2" :key="item" class="item">
              <component :is="item" v-model="form[item]" v-bind="attrs">{{ item }}</component>
            </div>
          </vuedraggable>
        </el-card>
        <el-pagination
      background
      layout="prev, pager, next"
      :total="1000">
    </el-pagination>
        <router-view/>
      </div>
    </template>

    <script>
    import vuedraggable from 'vuedraggable'
    import row1col2 from './components/row1col2.vue'
    export default {
      components: {
                vuedraggable,row1col2
      },
      name: 'App',
                   data: function () {
                      return {  
                      form: {},
                      attrs: { 'type': 'success' }, // , disabled: true
                      list: ['row1col2','el-rate', 'el-tag', 'el-button', 'el-switch', 'el-slider', 'el-time-select', 'el-input'],
                      list2: [],
                      }
                  },
                  methods: {
                     
                  }
    }
    </script>

    <style>
    #app {
      font-family: 'Avenir', Helvetica, Arial, sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-align: center;
      color: #2c3e50;
      margin-top: 60px;
    }
    .box-card{width:100%;}
    </style>

    <template>
    <el-row >
    <el-col :span=12>
          <vuedraggable v-model="list"   :group="{ name: 'course'}">
            <div v-for="item in list" :key="item" class="item">
                <component :is="item" v-model="form[item]" v-bind="attrs">{{ item }}</component>
            </div>
          </vuedraggable>
    </el-col>
    <el-col :span=12>
          <vuedraggable v-model="list2"   :group="{ name: 'course' }">
            <div v-for="item in list2" :key="item" class="item">
              <component :is="item" v-model="form[item]" v-bind="attrs">{{ item }}</component>
            </div>
          </vuedraggable>
    </el-col>
    </el-row>
    </template>

    <script>    
    import vuedraggable from 'vuedraggable'
    export default {
          components: {
                vuedraggable,
      },
      name: 'row1col2',
      data () {
        return {
                              form: {},
                      attrs: { 'type': 'success' }, // , disabled: true
                      list: [],
                      list2: [],
          msg: 'Welcome to Your Vue.js App'
        }
      },
                  methods: {
                     
                  }
    }
    </script>
    <style scoped>
    .el-col {
           height:40px;
           line-height:40px;
           border:1px solid #000;
    }
    .item>div{height:40px;}
    li {
      display: inline-block;
      margin: 0 10px;
    }
    a {
      color: #42b983;
    }
    </style>
     

  • 相关阅读:
    【C++】之内存管理 - new/delete
    【input学习】App对input事件的反馈与waitqueue
    推荐10款3DMax样条线相关的神仙插件
    使用基于Roslyn的编译时AOP框架来解决.NET项目的代码复用问题
    PHP数组输出为xml的两种常见方法
    【OpenCV】车辆识别 目标检测 级联分类器 C++ 案例实现
    [附源码]计算机毕业设计springbootSwitch交流平台
    【LeetCode每日一题】——1379.找出克隆二叉树中的相同节点
    C++ Qt QMainWindow实现无边框窗口自定义标题栏可拖拽移动拉伸改变窗口大小
    ROS小车——创建ROS功能包(6)【ROS保姆注释教学】
  • 原文地址:https://blog.csdn.net/xiexuzhao/article/details/125374435