提交 54b85ac1 编写于 作者: sq3536's avatar sq3536

mk

上级 ba98dea5
......@@ -34,6 +34,22 @@ export default class AppFormJson extends Vue {
*/
@Prop() public data!: any;
/**
* 数据格式
*
* @type {*}
* @memberof AppFormJson
*/
@Prop() public schema?: any;
/**
* 格式选项
*
* @type {*}
* @memberof AppFormJson
*/
@Prop() public option?: any;
/**
* 当前值
*
......@@ -104,6 +120,36 @@ export default class AppFormJson extends Vue {
*/
public editor: any;
public getSchema(): any{
if(this.schema)
return this.schema;
else
return {};
}
public getOption(): any{
let _option={
schema: this.getSchema(),
theme: "bootstrap3",
iconlib: "fontawesome4",
disable_edit_json: true,
display_required_only: true,
disable_collapse: true,
disable_array_delete_last_row: true,
ajax: true,
};
if (this.CurrentVal) {
_option["startval"] = JSON.parse(this.CurrentVal);
}
if(this.option){
return Object.assign({},_option,this.option)
}
return _option;
}
/**
* 编辑器生成
*
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册