|
@@ -1,63 +1,10 @@
|
|
|
<template>
|
|
|
- <n-data-table
|
|
|
- :columns="columns"
|
|
|
- :data="data"
|
|
|
- :pagination="pagination"
|
|
|
- :bordered="false"
|
|
|
- />
|
|
|
+ <vue-pdf-embed :source="pdfSource" />
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { h } from "vue";
|
|
|
-import { NButton } from "naive-ui";
|
|
|
-
|
|
|
-const message = useMessage();
|
|
|
-
|
|
|
-const createColumns = ({ play }) => {
|
|
|
- return [
|
|
|
- {
|
|
|
- title: "No",
|
|
|
- key: "no",
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Title",
|
|
|
- key: "title",
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Length",
|
|
|
- key: "length",
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Action",
|
|
|
- key: "actions",
|
|
|
- render(row) {
|
|
|
- return h(
|
|
|
- NButton,
|
|
|
- {
|
|
|
- strong: true,
|
|
|
- tertiary: true,
|
|
|
- size: "small",
|
|
|
- onClick: () => play(row),
|
|
|
- },
|
|
|
- { default: () => "Play" }
|
|
|
- );
|
|
|
- },
|
|
|
- },
|
|
|
- ];
|
|
|
-};
|
|
|
-
|
|
|
-const data = [
|
|
|
- { no: 3, title: "Wonderwall", length: "4:18" },
|
|
|
- { no: 4, title: "Don't Look Back in Anger", length: "4:48" },
|
|
|
- { no: 12, title: "Champagne Supernova", length: "7:27" },
|
|
|
-];
|
|
|
-
|
|
|
-const columns = createColumns({
|
|
|
- play(row) {
|
|
|
- message.info(`Play ${row.title}`);
|
|
|
- },
|
|
|
-});
|
|
|
-const pagination = ref(false);
|
|
|
+import VuePdfEmbed from "vue-pdf-embed";
|
|
|
+import pdfSource from "@/assets/1.pdf"
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style scoped></style>
|