1107
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<!-- 万能表单 -->
|
||||
<view v-if="scene === 'form'">
|
||||
<el-divider content-position="left">{{column.title}}</el-divider>
|
||||
<!-- <el-input :value="value" @input="_input"></el-input> -->
|
||||
</view>
|
||||
<!-- 万能表格 -->
|
||||
<view v-else-if="scene === 'table'">
|
||||
<text>{{ value }}</text>
|
||||
</view>
|
||||
<!-- 万能表格详情 -->
|
||||
<view v-else-if="scene === 'detail'">
|
||||
<text>{{ value }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
// 双向绑定的值
|
||||
value: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
// 字段规则
|
||||
column: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
// 当前场景 form 万能表单 table 万能表格 detail 表格详情页
|
||||
scene: {
|
||||
type: String,
|
||||
default: "form"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
// 组件加载完成时触发
|
||||
mounted() {
|
||||
|
||||
},
|
||||
// 组件函数
|
||||
methods: {
|
||||
_input(value){
|
||||
// 固定顺序,先input,再change
|
||||
// this.$emit("input", value);
|
||||
// this.$emit("change", value);
|
||||
}
|
||||
},
|
||||
// 监听器
|
||||
watch: {
|
||||
|
||||
},
|
||||
// 计算属性
|
||||
computed: {
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user