Skip to content
Discussion options

You must be logged in to vote

这是ai给出的/.vitepress/theme/components/Waline.vue,我实测可行:

<template>
  <div class="waline-wrapper">
    <div ref="walineRef" class="waline-container"></div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted, watch, nextTick } from 'vue'
import { useData } from 'vitepress'
import { init } from '@waline/client'
import '@waline/client/style'

const props = defineProps({
  serverURL: {
    type: String,
    required: true
  }
})

const { isDark } = useData()
const walineRef = ref<HTMLElement>()
let walineInstance: any = null

// 获取 VitePress 主题色
const getBrandColor = () => {
  return getComputedStyle(document.documentElement)
      .getPropertyValue('--vp-c-brand-1')
      .trim

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lizheming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants