前端批量打印的可能性问题?
通过在同一抽屉组件多次渲染打印内容 实现批量打印,不知道除了使用一些第三方的打印组件,其他的方案是怎么做的。
目前我这种方法,没有在循环组件的时候加上key值,但是页面也没有出现问题,疑惑在什么情况下会出现问题,以及我这种批量打印写法可能会存在的问题。
附代码片段。
<Drawer
closable
v-model="craftSheetData.show"
>
<template v-if="batchPrintShow">
<craftSheet
v-for="(_i, index) in state.checkedTableList"
:batchPrint="{
isBatch: true,
isBatchEnd:
index == state.checkedTableList.length - 1 ? true : false,
}"
v-if="craftSheetData.show && craftSheetData.customType === ''"
:rowData="_i"
>
</craftSheet>
</template>
<template v-else>
<craftSheet
v-if="craftSheetData.show && craftSheetData.customType === ''"
:rowData="state.rowData"
>
</craftSheet>
</template>
</Drawer>
数据发生变动,导致页面重新渲染的时候可能出现问题