• 界面拖动界面拖动


    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>
     

  • 相关阅读:
    vulnhub靶机DC9
    机器学习(三)之监督学习2
    excel如何查找两张表格共有的名单信息
    【云原生】springboot项目打包部署docker镜像
    高校宿舍系统
    北理工嵩天Python语言程序设计笔记(9 程序设计方法学)
    Unity - Shader Compiled Log
    web安全最亲密的战友Burp Suite—网络攻防常用工具介绍--burp suit工具初体验一
    MySQL索引原理以及SQL优化
    discuz教程 毫无基础常识的站长搭建HTTPS。图文并茂
  • 原文地址:https://blog.csdn.net/xiexuzhao/article/details/125374435