Skip to content

A Vercount API based counting plugin for Valaxy, serving as an alternative to Busuanzi counting. 基于 Vercount API 实现的 Valaxy 计数插件, 用于不蒜子计数替代方案

Notifications You must be signed in to change notification settings

valaxyjs/valaxy-addon-vercount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

valaxy-addon-vercount

A Vercount API based counting plugin for Valaxy, serving as an alternative to Busuanzi counting

NPM version

Features

  • ⚡ High-speed response, server response time less than 10ms
  • 🌎 Option to use China accelerated version or default Vercel global CDN for the API
  • 📊 Statistics through POST requests, supporting mobile devices and various browsers, with high accuracy
  • 🔒 Use of JSON callbacks to avoid CSRF attacks
  • 🔄 Automatically synchronizes all Busuanzi data

Installing this Plugin

pnpm add valaxy-addon-vercount
import { defineValaxyConfig } from 'valaxy'
import { addonVercount } from 'valaxy-addon-vercount'

export default defineValaxyConfig({
  addons: [
    addonVercount(),
  ],
})

Using this Plugin

<script lang="ts" setup>
import { useAddonVercount } from 'valaxy-addon-vercount'

const { page, site } = useAddonVercount()
</script>

<template>
  <span>Article reads: {{ page.pv }}</span>
  <span>Article visitors: {{ page.uv }}</span>
  <span>Site visits: {{ site.pv }}</span>
  <span>Site visitors: {{ site.uv }}</span>
</template>

Configuration / Options

Name Type Default Description
api string --- Fill in 'cn' for the China optimized version, or other values for custom API
baseUrl string --- Gets the source of the current page, default is automatically window.location.origin
placeholder string | number | null '-' Placeholder for visit count

Thanks

About

A Vercount API based counting plugin for Valaxy, serving as an alternative to Busuanzi counting. 基于 Vercount API 实现的 Valaxy 计数插件, 用于不蒜子计数替代方案

Topics

Resources

Stars

Watchers

Forks