diff --git a/src/assets/style/global.scss b/src/assets/style/global.scss index 8a1a181..22ad855 100644 --- a/src/assets/style/global.scss +++ b/src/assets/style/global.scss @@ -1,3 +1,6 @@ html,body,#app{ height: 100%; +} +*{ + user-select: none; } \ No newline at end of file diff --git a/src/data/component-list.js b/src/data/component-list.js index 987c362..75155de 100644 --- a/src/data/component-list.js +++ b/src/data/component-list.js @@ -7,10 +7,29 @@ let list = [ props: {}, id: "customID", style: { + color: 'red', left: 0, top: 0, width: 80, height: 32, + zIndex: 1 + }, + }, + { + name: "img", + describe: "图片", + type: "component", + slot: [], + props: { + draggable:"false", + src: 'https://scpic.chinaz.net/files/pic/pic9/202101/bpic22299.jpg' + }, + id: "imgID", + style: { + left: 0, + top: 0, + width: 380, + height: 200, }, }, { @@ -34,7 +53,9 @@ let list = [ describe: "输入框", type: "component", slot: [], - props: {}, + props: { + placeholder:'请输入' + }, id: "inputID", style: { height: 32, @@ -126,5 +147,9 @@ let list = [ }, }, ]; +list = list.map(v=>{ + v.origin = JSON.parse(JSON.stringify(v.style)); + return v +}) export default list; diff --git a/src/main.js b/src/main.js index 70e6d83..69cfa58 100644 --- a/src/main.js +++ b/src/main.js @@ -13,12 +13,12 @@ Vue.config.productionTip = process.env.NODE_ENV === 'production' ? true : false; Vue.use(toast); -Vue.prototype.$computeStyle= function(style){ +Vue.prototype.$computeStyle= function(style,isDefault=false){ let myStyle = cloneDeep(style); let attr = ["left", "width", "height", "top", "right", "bottom"]; let attrStr = ["backgroundColor", "color","position",'zIndex']; Object.keys(style).forEach((v) => { - if (attr.indexOf(v) != -1 && typeof style[v] == "number") { + if (!isDefault&&attr.indexOf(v) != -1 && typeof style[v] == "number") { myStyle[v] = style[v] + "px"; } if (attrStr.indexOf(v) != -1) { diff --git a/src/ui/detail/detail.vue b/src/ui/detail/detail.vue index 59791ac..99886e9 100644 --- a/src/ui/detail/detail.vue +++ b/src/ui/detail/detail.vue @@ -3,13 +3,14 @@