You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.5 KiB
Vue

<template>
<div
:style="{width:props.dimensions.width+'px',height:props.dimensions.height+'px'}">
<NodeResizer :min-width="96 / 2.54" :min-height="96 / 2.54" :max-width="pageSize.width"
:max-height="pageSize.height" color="#000"
v-if="!props.isView && !props.isHideHandle && props.selected" />
<div class="custom-node"
:style="{textAlign:props.data.options.align,width:props.dimensions.width+'px',lineHeight:props.dimensions.height+'px',height:props.dimensions.height+'px',pointerEvents:props.isView?'auto': 'none'}">
<svg
:style="{ width:props.dimensions.width+'px',height:props.dimensions.height+'px' }"
id="barcode"></svg>
</div>
</div>
</template>
<script setup>
import JsBarcode from 'jsbarcode';
import { defineProps } from 'vue';
import { NodeResizer } from '@vue-flow/node-resizer';
const props = defineProps({
isView: {
type: Boolean,
required: false
},
isHideHandle: {
type: Boolean,
required: false
},
selected: {
type: Boolean,
required: false
},
data: {
type: Object,
required: true
},
dimensions: {
type: Object,
required: true
},
pageSize: {
type: Object,
required: true
}
});
onMounted(() => {
JsBarcode('#barcode', '1234567890abc', {
format: 'CODE128',
lineColor: '#000',
width: 2,
height: 40,
displayValue: true
});
});
</script>
<style scoped>
.custom-node {
position: absolute;
}
</style>