4.1.3 • Published 1 year ago

vue3lowcode v4.1.3

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

更新版本时候 package.json 用 package2 ,开发时候用 package1

vue3lowcode 低代码

element-plus + vue3

安装依赖

npm install --registry=https://registry.npmmirror.com

开发调试

npm run serve

生产打包

npm run build

表单设计器 + 表单渲染器打包

npm run lib

更新到 npm 上 npm set registry https://registry.npmjs.org/ npm publish 更新完之后 npm config set registry http://registry.npm.taobao.org/

首次需要登录 npm npm adduser 输入 npm 账号密码

退出当前账号 npm logout

表单渲染器打包

npm run lib-render

浏览器兼容性

Chrome(及同内核的浏览器如QQ浏览器、360浏览器等等),Firefox,Safari

跟 Vue 3.x 项目集成

1. 安装包

npm i vue3lowcode

yarn add vue3lowcode

2. 引入并全局注册 vue3lowcode 组件

import { createApp } from 'vue'
import App from './App.vue'

import ElementPlus from 'element-plus'  //引入element-plus库
import 'element-plus/dist/index.css'  //引入element-plus样式

import VForm3 from 'vue3lowcode'  //引入VForm 3库
import 'vue3lowcode/dist/designer.style.css'  //引入VForm3样式

const app = createApp(App)
app.use(ElementPlus)  //全局注册element-plus
app.use(VForm3)  //全局注册VForm 3(同时注册了v-form-designer和v-form-render组件)

app.mount('#app')

3. 在 Vue 3.x 模板中使用表单设计器组件

<template>
  <v-form-designer ref="vfdRef"></v-form-designer>
</template>

<script setup>
  const vfdRef = ref(null);
</script>

<style lang="scss">
  body {
    margin: 0; /* 如果页面出现垂直滚动条,则加入此行CSS以消除之 */
  }
</style>

4. 在 Vue 3.x 模板中使用表单渲染器组件

<template>
  <div>
    <v-form-render
      :form-json="formJson"
      :form-data="formData"
      :option-data="optionData"
      ref="vFormRef"
    >
    </v-form-render>
    <el-button type="primary" @click="submitForm">Submit</el-button>
  </div>
</template>
<script setup>
  import { ref, reactive } from "vue";
  import { ElMessage } from "element-plus";

  const formJson = reactive({
    widgetList: [],
    formConfig: {
      modelName: "formData",
      refName: "vForm",
      rulesName: "rules",
      labelWidth: 80,
      labelPosition: "left",
      size: "",
      labelAlign: "label-left-align",
      cssCode: "",
      customClass: "",
      functions: "",
      layoutType: "PC",
      jsonVersion: 3,
      onFormCreated: "",
      onFormMounted: "",
      onFormDataChange: "",
    },
  });
  const formData = reactive({});
  const optionData = reactive({});
  const vFormRef = ref(null);

  const submitForm = () => {
    vFormRef.value
      .getFormData()
      .then((formData) => {
        console.log(formData);
      })
      .catch((error) => {
        ElMessage.error(error);
      });
  };
</script>
4.1.3

1 year ago

4.1.2

1 year ago

4.1.1

1 year ago

4.1.0

1 year ago

4.0.9

1 year ago

4.0.8

1 year ago

4.0.7

1 year ago

4.0.6

1 year ago

4.0.3

1 year ago

4.0.2

1 year ago

4.0.1

1 year ago

3.0.11

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

3.0.10

1 year ago