Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2024-06-06 17:55:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
78c2d2c401af1ca4952f37ffa05dfa34b2a369b1
78c2d2c4
1 parent
45975e02
签名组件默认值和只读显示
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
src/components/SignField/MyComponent.vue
src/components/SignField/MyComponent.vue
View file @
78c2d2c
<!--
* @Date: 2023-03-29 17:44:24
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 202
3-06-29 19:06:27
* @LastEditTime: 202
4-06-06 17:50:41
* @FilePath: /data-table/src/components/SignField/MyComponent.vue
* @Description: 文件描述
-->
<template>
<div style="width: 100%;">
<div ref="wrapperRef" class="esign-wrapper">
<div
v-if="!readonly"
ref="wrapperRef" class="esign-wrapper">
<vue-esign v-if="esignWidth" ref="esign" class="sign-wrapper" :width="esignWidth" :height="esignHeight" :isCrop="isCrop"
:lineWidth="lineWidth" :lineColor="lineColor" :bgColor.sync="bgColor" />
<div v-if="show_sign" class="whiteboard">
...
...
@@ -16,6 +16,16 @@
</div>
</div>
</div>
<div v-else class="esign-wrapper">
<div class="sign-wrapper">
<van-image
width="100%"
height="100%"
:src="default_value"
style="margin-right: 0.5rem; margin-block-end: 0.25rem;"
/>
</div>
</div>
<div v-if="!show_sign">
<div v-if="show_control" class="control-sign">
<van-row gutter="20" style="padding: 0 1rem">
...
...
@@ -58,11 +68,19 @@ const esign = ref(null);
let esignWidth = ref();
let esignHeight = ref();
const wrapperRef = ref(null)
const wrapperRef = ref(null);
const readonly = ref(false);
const default_value = ref('');
onMounted(() => {
if (props.component_props.readonly) {
readonly.value = props.component_props.readonly
}
if (props.component_props.default) {
default_value.value = props.component_props.default?.url
}
// 动态计算画板canvas宽度/高度
setTimeout(() => {
esignWidth.value = wrapperRef
.value
.offsetWidth - 32;
esignWidth.value = wrapperRef
?.value?
.offsetWidth - 32;
esignHeight.value = (window.innerHeight) / 5;
}, 100);
})
...
...
Please
register
or
login
to post a comment