Page.js 1.31 KB
Newer Older
1 2 3 4 5 6
import Anchor from "@theme/components/Anchor.vue";
import Comment from "@Comment";
import MyTransition from "@theme/components/MyTransition.vue";
import PageInfo from "@mr-hope/vuepress-plugin-comment/lib/client/PageInfo.vue";
import PageMeta from "@theme/components/PageMeta.vue";
import PageNav from "@theme/components/PageNav.vue";
7 8 9
import Password from "@theme/components/Password.vue";
import { pathEncryptMixin } from "@theme/mixins/pathEncrypt";
export default pathEncryptMixin.extend({
10 11 12 13 14 15 16 17
    name: "Page",
    components: {
        Anchor,
        Comment,
        MyTransition,
        PageInfo,
        PageMeta,
        PageNav,
18
        Password,
19 20 21 22 23 24 25 26 27 28 29
    },
    props: {
        sidebarItems: {
            type: Array,
            default: () => [],
        },
        headers: {
            type: Array,
            default: () => [],
        },
    },
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
    data: () => ({
        password: "",
    }),
    computed: {
        pagePassword() {
            const { password } = this.$frontmatter;
            return typeof password === "number"
                ? password.toString()
                : typeof password === "string"
                    ? password
                    : "";
        },
        pageDescrypted() {
            return this.password === this.pagePassword;
        },
    },
46
});
47
//# sourceMappingURL=Page.js.map