提交 f999acda authored 作者: wangjiahao's avatar wangjiahao

feat:文字组件增加透视功能

上级 044faf78
...@@ -41,6 +41,14 @@ ...@@ -41,6 +41,14 @@
<el-input v-model="styleInfo.letterSpacing" type="number" size="mini" min="0" max="99" @change="styleChange" /> <el-input v-model="styleInfo.letterSpacing" type="number" size="mini" min="0" max="99" @change="styleChange" />
</div> </div>
<el-tooltip :content="$t('panel.opacity')">
<i style="float: left;margin-top: 3px;margin-left: 2px;" class="icon iconfont icon-touming" />
</el-tooltip>
<div style="width: 70px;float: left;margin-top: 2px;margin-left: 2px;">
<el-input v-model="innerOpacity" type="number" size="mini" min="0" max="100" step="10" @change="styleChange" />
</div>
<div style="width: 20px;float: left;margin-top: 2px;margin-left: 10px;"> <div style="width: 20px;float: left;margin-top: 2px;margin-left: 10px;">
<div style="width: 16px;height: 18px"> <div style="width: 16px;height: 18px">
<el-tooltip :content="$t('panel.color')"> <el-tooltip :content="$t('panel.color')">
...@@ -79,6 +87,7 @@ export default { ...@@ -79,6 +87,7 @@ export default {
}, },
data() { data() {
return { return {
innerOpacity: 0,
textAlignOptions: [ textAlignOptions: [
{ {
icon: 'iconfont icon-juzuo', icon: 'iconfont icon-juzuo',
...@@ -97,8 +106,19 @@ export default { ...@@ -97,8 +106,19 @@ export default {
} }
] } ] }
}, },
watch: {
innerOpacity: {
handler(oldVal, newVal) {
this.styleInfo['opacity'] = this.innerOpacity / 100
}
}
},
mounted() {
if (this.styleInfo['opacity']) {
this.innerOpacity = this.styleInfo['opacity'] * 100
}
},
computed: { computed: {
letterDivColor() { letterDivColor() {
const style = { const style = {
height: '2px', height: '2px',
...@@ -153,7 +173,7 @@ export default { ...@@ -153,7 +173,7 @@ export default {
ps = x + 60 ps = x + 60
} }
// 防止toolbar超出边界 // 防止toolbar超出边界
const xGap = ps + 395 - this.canvasWidth const xGap = ps + 495 - this.canvasWidth
// console.log('canvasWidth:' + this.canvasWidth + ';xGap:' + xGap) // console.log('canvasWidth:' + this.canvasWidth + ';xGap:' + xGap)
if (xGap > 0) { if (xGap > 0) {
return ps - xGap return ps - xGap
...@@ -185,7 +205,7 @@ export default { ...@@ -185,7 +205,7 @@ export default {
.el-card-main { .el-card-main {
height: 34px; height: 34px;
z-index: 10; z-index: 10;
width: 450px; width: 550px;
position: absolute; position: absolute;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论