feat(projects): add page plugin_editor、plugin_icon、plugin_map、plugin_print、plugin_swiper and plugin_video (#430)

This commit is contained in:
lisong
2024-05-07 21:56:23 +08:00
committed by GitHub
parent daf6600c21
commit a2110a98cf
26 changed files with 784 additions and 7 deletions

View File

@@ -0,0 +1,39 @@
<script lang="ts" setup>
import printJS from 'print-js';
function printTable() {
printJS({
printable: [
{ name: 'soybean', wechat: 'honghuangdc', remark: '欢迎来技术交流' },
{ name: 'soybean', wechat: 'honghuangdc', remark: '欢迎来技术交流' }
],
properties: ['name', 'wechat', 'remark'],
type: 'json'
});
}
function printImage() {
printJS({
printable: [
'https://i.loli.net/2021/11/24/1J6REWXiHomU2kM.jpg',
'https://i.loli.net/2021/11/24/1J6REWXiHomU2kM.jpg'
],
type: 'image',
header: 'Multiple Images',
imageStyle: 'width:100%;'
});
}
</script>
<template>
<div class="h-full">
<NCard title="打印" :bordered="false" class="card-wrapper">
<NButton type="primary" class="mr-10px" @click="printTable">打印表格</NButton>
<NButton type="primary" @click="printImage">打印图片</NButton>
<template #footer>
<GithubLink label="printJS" link="https://github.com/crabbly/Print.js" class="mt-10px" />
</template>
</NCard>
</div>
</template>
<style scoped></style>