-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(styles): support for always-on preview (#68)
* feat: support for always-on preview * 显示加载数量
- Loading branch information
Showing
4 changed files
with
53 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,22 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{ | ||
style: Style; | ||
mode?: "sample" | "full"; | ||
}>(); | ||
const style = props.style; | ||
const mode = props.mode ?? "sample"; | ||
</script> | ||
|
||
<template> | ||
<template v-if="mode === 'sample'"> | ||
<client-only> | ||
<el-popover trigger="hover" width="90%"> | ||
<template #reference> | ||
{{ style.title }} | ||
</template> | ||
<div class="csl-preview"> | ||
<h3>引注</h3> | ||
<div v-html="style.citations"></div> | ||
<h3>参考文献表</h3> | ||
<div v-html="style.bibliography"></div> | ||
</div> | ||
</el-popover> | ||
</client-only> | ||
</template> | ||
<template v-else> | ||
<h2>{{ style.title }}</h2> | ||
<div class="csl-preview"> | ||
<h3>引注</h3> | ||
<div v-html="style.citations" class="csl-preview-citations"></div> | ||
<h3>参考文献表</h3> | ||
<div v-html="style.bibliography" class="csl-preview-bibliography"></div> | ||
</div> | ||
</template> | ||
<client-only> | ||
<el-popover trigger="hover" width="90%"> | ||
<template #reference> | ||
<a :href="style.dir">{{ style.title }}</a> | ||
</template> | ||
<div class="csl-preview"> | ||
<h3>引注</h3> | ||
<div v-html="style.citations"></div> | ||
<h3>参考文献表</h3> | ||
<div v-html="style.bibliography"></div> | ||
</div> | ||
</el-popover> | ||
</client-only> | ||
</template> | ||
|
||
<style> | ||
.csl-preview { | ||
/* font-family: Georgia, Times, "Times New Roman", serif; */ | ||
font-size: 1rem; | ||
} | ||
.csl-preview h3 { | ||
font-weight: bold; | ||
font-size: 1.5rem; | ||
margin: 1rem 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{ | ||
style: Style; | ||
}>(); | ||
const style = props.style; | ||
</script> | ||
|
||
<template> | ||
<a :href="style.dir"> | ||
<h2>{{ style.title }}</h2> | ||
</a> | ||
<div class="csl-preview"> | ||
<h3>引注</h3> | ||
<div v-html="style.citations" class="csl-preview-citations"></div> | ||
<h3>参考文献表</h3> | ||
<div v-html="style.bibliography" class="csl-preview-bibliography"></div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters