Files
workflow/app/view/component/tpl/tplFormDesign.html
T

75 lines
1.6 KiB
HTML

<template id="tpl-form-design">
<div class="tpl-form-design-container">
<form-item-list-generator
:form-item-list="form"
ref="formItemListGenerator"/>
</div>
</template>
{% include 'component/tpl/formItemListGenerator.html' %}
<script type="module">
Vue.component("tpl-form-design", {
template: "#tpl-form-design",
props: {
form: {
type: Array,
default: () => {
return []
}
}
},
data: () => ({
}),
computed: {
versionList () {
const list = this.articleAssignmentListWithAnswer.map(item => {
return { text: item.version, value: item.version }
})
return list;
},
formItemList () {
let list = []
if (this.articleAssignmentListWithAnswer[this.selectedVersionIndex]) {
list = this.articleAssignmentListWithAnswer[this.selectedVersionIndex].formItemList;
}
return list;
}
},
watch: {
// 每个属性值发生变化就会调用这个函数
form(newVal, oldVal) {
this.saveData(newVal)
},
// 深度监听 属性的变化
deep: true
},
async created() {
},
mounted() {},
methods: {
saveData(newVal) {
// this.$emit('change-structure', this.form);
}
}
})
</script>
<style scoped>
.tpl-form-design-container {
width: 100%;
height: 650px;
max-height: 700px;
overflow-y: auto;
}
@media (max-width: 500px) {
.tpl-form-design-container {
width: 100%;
height: auto;
max-height: none;
overflow-y: hidden;
}
}
</style>