Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yulania/progress

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yulania/progress

browser top progress bar

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Progress

前端进度条组件。

release

基本示例

import { useProgress } from '@yulania/progress'

const { start, done } = useProgress()
start()
window.onload = () => done()
// 若在 SPA 的路由中也设置了进度条, 可以传入 `true` 立即完成当前进度条, 转为路由中定义的进度条
// window.onload = () => done(true)

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Progress</title>
  <link rel="stylesheet" href="./index.css">
  <!-- 可以立即执行以尽快的显示进度条 -->
  <script src="./src/progress.ts" type="module"></script>
  <script src="./src/main.ts" type="module"></script>
</head>
<body>
  <div id="app"></div>
</body>
</html>

Astro 集成

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@yulania/progress/dist/classic.css">
<script src="https://cdn.jsdelivr.net/npm/@yulania/progress/dist/astro.global.js"></script>

TypeScript

在 TS 类型声明文件 (如 global.d.ts ) 中拓展 globalThis 的类型

import type { useProgress } from '@yulania/progress'

declare global {
  // eslint-disable-next-line no-var
  var yulania: {
    progress: ReturnType<typeof useProgress>
  }
}

Inspired by

NProgress - [ricardo-ch/react-nprogress]

Keywords

FAQs

Package last updated on 18 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc