|
@@ -1,45 +1,47 @@
|
|
|
<template>
|
|
|
- <div :style="styleObj">
|
|
|
- <component :is="value.setup.showtype" :value="value" :style="styleObj"/>
|
|
|
- </div>
|
|
|
+ <div :style="styleObj">
|
|
|
+ <component :is="value.setup.showtype" :value="value" :style="styleObj"/>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
export default ({
|
|
|
- data() {
|
|
|
- return {
|
|
|
- optionsStyle: {}, // 样式
|
|
|
- }
|
|
|
- },
|
|
|
- props: {
|
|
|
- value: Object,
|
|
|
- ispreview: Boolean,
|
|
|
- widgetIndex: {
|
|
|
- type: Number,
|
|
|
- default: 0,
|
|
|
- }, // 当前组件,在工作区变量widgetInWorkbench中的索引
|
|
|
+ name: "widgetDecoration",
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ optionsStyle: {}, // 样式
|
|
|
+ }
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ value: Object,
|
|
|
+ ispreview: Boolean,
|
|
|
+ widgetIndex: {
|
|
|
+ type: Number,
|
|
|
+ default: 0,
|
|
|
+ }, // 当前组件,在工作区变量widgetInWorkbench中的索引
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ value: {
|
|
|
+ handler(val) {
|
|
|
+ this.optionsStyle = val.position;
|
|
|
+ this.optionsData = val.data;
|
|
|
+ this.optionsCollapse = val.collapse;
|
|
|
+ this.optionsSetup = val.setup;
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
},
|
|
|
- watch: {
|
|
|
- value: {
|
|
|
- handler(val) {
|
|
|
- this.optionsStyle = val.position;
|
|
|
- this.optionsData = val.data;
|
|
|
- this.optionsCollapse = val.collapse;
|
|
|
- this.optionsSetup = val.setup;
|
|
|
- },
|
|
|
- deep: true,
|
|
|
- },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ styleObj() {
|
|
|
+ return {
|
|
|
+ position: this.ispreview ? "absolute" : "static",
|
|
|
+ width: this.optionsStyle.width + "px",
|
|
|
+ height: this.optionsStyle.height + "px",
|
|
|
+ left: this.optionsStyle.left + "px",
|
|
|
+ top: this.optionsStyle.top + "px",
|
|
|
+ };
|
|
|
},
|
|
|
- computed: {
|
|
|
- styleObj() {
|
|
|
- return {
|
|
|
- position: this.ispreview ? "absolute" : "static",
|
|
|
- width: this.optionsStyle.width + "px",
|
|
|
- height: this.optionsStyle.height + "px",
|
|
|
- left: this.optionsStyle.left + "px",
|
|
|
- top: this.optionsStyle.top + "px",
|
|
|
- };
|
|
|
- },
|
|
|
- }
|
|
|
+ }
|
|
|
})
|
|
|
</script>
|
|
|
-<style scoped lang="scss"></style>
|
|
|
+<style scoped lang="scss"></style>
|