Commit 605a9e1a authored by 郝聪敏's avatar 郝聪敏

fix: dots保存在组件内部

parent 92c63c3c
This diff is collapsed.
...@@ -23,7 +23,7 @@ export default class Activity extends Vue { ...@@ -23,7 +23,7 @@ export default class Activity extends Vue {
@Watch('pageName', { immediate: true }) @Watch('pageName', { immediate: true })
onPageNameChange(newVal) { onPageNameChange(newVal) {
if (newVal) { if (EASY_ENV_IS_BROWSER && newVal) {
document.title = newVal; document.title = newVal;
// 如果是 iOS 设备,则使用如下 hack 的写法实现页面标题的更新 // 如果是 iOS 设备,则使用如下 hack 的写法实现页面标题的更新
if (navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) { if (navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
......
...@@ -119,6 +119,9 @@ export default class DynamicForm extends Mixins(ContextMenu) { ...@@ -119,6 +119,9 @@ export default class DynamicForm extends Mixins(ContextMenu) {
case 'number' : case 'number' :
result = 'Number'; result = 'Number';
break; break;
case 'Upload':
result = 'Upload';
break;
} }
return result; return result;
} }
......
...@@ -16,6 +16,8 @@ export default class FreedomContainer extends Mixins(ContextMenu) { ...@@ -16,6 +16,8 @@ export default class FreedomContainer extends Mixins(ContextMenu) {
@Prop({ type: Boolean, default: false }) showHeader; @Prop({ type: Boolean, default: false }) showHeader;
@Prop(String) backgroundImage; @Prop(String) backgroundImage;
dots: object = {};
mousedown(childIndex, event) { mousedown(childIndex, event) {
this.setDragable(false); this.setDragable(false);
const childItem = cloneDeep(this.childItem); const childItem = cloneDeep(this.childItem);
...@@ -63,7 +65,7 @@ export default class FreedomContainer extends Mixins(ContextMenu) { ...@@ -63,7 +65,7 @@ export default class FreedomContainer extends Mixins(ContextMenu) {
@Watch('curChildIndex') @Watch('curChildIndex')
onIndexChange(newVal) { onIndexChange(newVal) {
this.childItem.child.forEach(item => delete item.dots); this.dots = {};
if (newVal || newVal === 0) { if (newVal || newVal === 0) {
this.setPointStyle(); this.setPointStyle();
} }
...@@ -74,14 +76,12 @@ export default class FreedomContainer extends Mixins(ContextMenu) { ...@@ -74,14 +76,12 @@ export default class FreedomContainer extends Mixins(ContextMenu) {
this.$nextTick(() => { this.$nextTick(() => {
const points = ['lt', 'rt', 'lb', 'rb', 'l', 'r', 't', 'b']; const points = ['lt', 'rt', 'lb', 'rb', 'l', 'r', 't', 'b'];
const [height, width] = this.getHW(this.curChildIndex); const [height, width] = this.getHW(this.curChildIndex);
const dots = points.reduce((pre, cur) => { this.dots[this.curChildIndex] = points.reduce((pre, cur) => {
pre[cur] = convertPointStyle(cur, {height, width}); pre[cur] = convertPointStyle(cur, {height, width});
return pre; return pre;
}, {}); }, {});
const childEle = this.childItem.child[this.curChildIndex]; const childEle = this.childItem.child[this.curChildIndex];
// this.updatePageInfo({ containerIndex: this.containerIndex, childIndex: this.curChildIndex, data: { ...childEle, commonStyle: { ...childEle.commonStyle, height: +height, width: +width } } });
this.updateCommonStyle({ containerIndex: this.containerIndex, childIndex: this.curChildIndex, data: { ...childEle.commonStyle, height: +height, width: +width }}); this.updateCommonStyle({ containerIndex: this.containerIndex, childIndex: this.curChildIndex, data: { ...childEle.commonStyle, height: +height, width: +width }});
this.$set(this.childItem.child[this.curChildIndex], 'dots', dots);
}); });
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div v-for="(item, index) in childItem.child" :style="transformStyle(item.commonStyle, 'container')" :class="['freedom-body-item', { 'Fb-item_selected': curChildIndex === index }]" :key="index" @click.stop="handleElementClick(containerIndex, index)" @mousedown.stop="mousedown(index, $event)" @contextmenu.prevent.stop="show($event, containerIndex, index)"> <div v-for="(item, index) in childItem.child" :style="transformStyle(item.commonStyle, 'container')" :class="['freedom-body-item', { 'Fb-item_selected': curChildIndex === index }]" :key="index" @click.stop="handleElementClick(containerIndex, index)" @mousedown.stop="mousedown(index, $event)" @contextmenu.prevent.stop="show($event, containerIndex, index)">
<component ref="childComponent" :style="transformStyle(item.commonStyle, 'component')" :is="item.name" v-bind="item.props"></component> <component ref="childComponent" :style="transformStyle(item.commonStyle, 'component')" :is="item.name" v-bind="item.props"></component>
<div class="freedom-body-dot" <div class="freedom-body-dot"
v-for="(style, key) in item.dots" v-for="(style, key) in dots[index]"
:key="key" :key="key"
:style="style" :style="style"
@mousedown.stop.prevent="handleMouseDownOnPoint(key, $event)"/> @mousedown.stop.prevent="handleMouseDownOnPoint(key, $event)"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment