翻转新样式
This commit is contained in:
@@ -1,18 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="sealDrawer">
|
<section class="sealDrawer">
|
||||||
<slot name="tools"/>
|
<slot name="tools"/>
|
||||||
<div class="resetSignature left" @click.stop="handleClean">重写</div>
|
|
||||||
<div class="resetSignature" @click.stop="submit">提交</div>
|
|
||||||
<div v-if="drawPlaceholder" class="placeholder">{{ placeholder }}</div>
|
<div v-if="drawPlaceholder" class="placeholder">{{ placeholder }}</div>
|
||||||
<canvas disable-scroll type="canvas" canvas-id="drawer" id="drawer" @mousedown.stop="handleDrawStart"
|
<canvas disable-scroll type="canvas" canvas-id="drawer" id="drawer" @mousedown.stop="handleDrawStart"
|
||||||
@mouseup.stop="handleDrawEnd" @mouseleave="handleDrawEnd" @mousemove.stop="handleDrawing"
|
@mouseup.stop="handleDrawEnd" @mouseleave="handleDrawEnd" @mousemove.stop="handleDrawing"
|
||||||
@touchstart.stop="handleDrawStart" @touchend.stop="handleDrawEnd" @touchmove="handleDrawing"/>
|
@touchstart.stop="handleDrawStart" @touchend.stop="handleDrawEnd" @touchmove="handleDrawing"/>
|
||||||
|
<AiBottomBtn v-if="isVertical">
|
||||||
|
<div flex>
|
||||||
|
<div class="fill text reset" @click.stop="handleClean">重写</div>
|
||||||
|
<div class="fill text" @click.stop="submit">提交</div>
|
||||||
|
</div>
|
||||||
|
</AiBottomBtn>
|
||||||
|
<template v-else>
|
||||||
|
<div class="resetSignature left" @click.stop="handleClean">重写</div>
|
||||||
|
<div class="resetSignature" @click.stop="submit">提交</div>
|
||||||
|
</template>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import AiBottomBtn from "../AiBottomBtn";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "sealDrawer",
|
name: "sealDrawer",
|
||||||
|
components: {AiBottomBtn},
|
||||||
appName: "签名",
|
appName: "签名",
|
||||||
props: {
|
props: {
|
||||||
placeholder: {type: String, default: "请在此处清晰书写你的签名"},
|
placeholder: {type: String, default: "请在此处清晰书写你的签名"},
|
||||||
@@ -21,7 +32,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
drawing: false,//判断是否处于绘画中
|
drawing: false,//判断是否处于绘画中
|
||||||
drawer: {},
|
drawer: {},
|
||||||
drawPlaceholder: true
|
drawPlaceholder: true,
|
||||||
|
isVertical: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -30,11 +42,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
window.onorientationonchange = () => {
|
this.isVertical = ![90, -90].includes(window.orientation)
|
||||||
if ([90, -90].includes(window.orientation)) {
|
window.onresize = () => {
|
||||||
|
this.isVertical = ![90, -90].includes(window.orientation)
|
||||||
location.reload()
|
location.reload()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
this.initDrawer()
|
this.initDrawer()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -141,5 +153,10 @@ export default {
|
|||||||
font-size: 64px;
|
font-size: 64px;
|
||||||
color: #DDDDDD;
|
color: #DDDDDD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::v-deep.reset {
|
||||||
|
background-color: #fff;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user