
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
app-template-render
Advanced tools
ATR是一个基于`VUE3`和`ElementPlus`的纯前端渲染组件,也仅仅是一个前端渲染组件,可以做到通过相应的`JSON`生成简单的表单和视图,提高前端开发效率
ATR是一个基于VUE3和ElementPlus的纯前端渲染组件,也仅仅是一个前端渲染组件,可以做到通过相应的JSON生成简单的表单和视图,提高前端开发效率
面对B端页面的开发,前端更多的是CV一下之前差不多的页面,改UI改接口,然后就没有然后了,小团队立马开发出一套低代码工具来实现项目阻力也比较大,所以就搞了个ATR来提高一点前端的开发效率
# NPM
npm install app-template-render
# Yarn
yarn add app-template-render
import appTemplateRender from 'app-template-render'
import 'app-template-render/dist/appTempRender.css'
const app = createApp(App)
app.use(appTemplateRender)
<template>
<div class="demo-list">
<view-render
:viewData="listViewData"
:layouts="listViewConfig.layouts"
:components="listViewConfig.components"
:searchForm="searchFormConfig"
@search="handleSearch"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
@change="handleValueChange"
/>
</div>
</template>
<script>
export default {
name: 'ListDemo',
data() {
return {
// 查询表单配置
searchFormConfig: searchForm,
// 视图配置
listViewConfig: listView,
// 视图
listViewData: {
// 列表数据
list: [],
// 查询表单
search: {
name: '',
address: ''
},
// 分页数据
pagination: {
currentPage: 1,
pageSize: 10,
total: 0
}
}
}
},
methods: {
/**
* 查询
*/
handleSearch() {
...
},
/**
* 修改每页条数
* @param {Number} size 每页条数
*/
handleSizeChange(size) {
...
},
/**
* 翻页
* @param {Number} current 页数
*/
handleCurrentChange(current) {
...
}
}
}
</script>
<template>
<el-form
class="demo-form"
label-position="right"
label-width="120px"
:model="formData"
>
<form-render
:formData="formData"
:layouts="formTemp.layouts"
:components="formTemp.components"
@change="handleValueChange"
/>
</el-form>
</template>
<script>
import appTemplateRender from 'app-template-render'
const { setValue } = appTemplateRender.Utils
export default {
name: 'DemoForm',
data() {
return {
// 表单配置
formTemp,
// 表单数据
formData: {
name: '',
address: ''
}
}
},
methods: {
/**
* 修改值
* @param {*} val 控件值
* @param {String} id 控件id
*/
handleValueChange(val, id) {
const component = this.formTemp.components.find((item) => item.id === id)
if (component) {
setValue(this.formData, component.fieldPath, val)
}
}
}
}
</script>
https://ctank.github.io/app-template-render/play
数据保存在localStorage中
需要写在<el-form>中,不含操作按钮
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| formData | 表单数据 | object | null |
| layouts | 控件布局 | array | [] |
| components | 控件集合 | array | [] |
| 方法 | 说明 | 参数 |
|---|---|---|
| change | 配合工具方法 setValue 修改表单数据 | 值, 控件ID |
| getValue | 获取数据,目前用于 多选 和 下拉 控件通过接口获取选项 | {id: 控件ID, field: 字段, relateValue: 关联字段值}, 回调 |
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| viewData | 表单数据 | object | null |
| layouts | 控件布局 | array | [] |
| components | 控件集合 | array | [] |
| searchForm | 查询表单配置 | form-render | null |
| 方法 | 说明 | 参数 |
|---|---|---|
| change | 配合工具方法 setValue 修改表单数据 | 值, 控件ID |
| getValue | 获取数据,目前用于 多选 和 下拉 控件通过接口获取选项 | {id: 控件ID, field: 字段, relateValue: 关联字段值}, 回调 |
| current-change | current-page 改变时触发 | 新当前页 |
| size-change | page-size 改变时触发 | 新每页条数 |
| 方法 | 说明 | 参数 |
|---|---|---|
| setValue | 根据字段路径修改字段值 | data, path, value |
| cascader.areaDataCodeToText | 区域选择使用element-china-area-data | areaDataCodeToText = CodeToText |
| cascader.areaDataTextToCode | 区域选择使用element-china-area-data | areaDataTextToCode = TextToCode |
FAQs
ATR是一个基于`VUE3`和`ElementPlus`的纯前端渲染组件,也仅仅是一个前端渲染组件,可以做到通过相应的`JSON`生成简单的表单和视图,提高前端开发效率
The npm package app-template-render receives a total of 4 weekly downloads. As such, app-template-render popularity was classified as not popular.
We found that app-template-render demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.