@zlicom/auto-prefixer
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

@zlicom/autoprefixer

NPM version NPM downloads MIT License

Installation

$ npm install @zlicom/autoprefixer --save-dev

Why @zlicom/autoprefixer ?

  • 轻量级前缀添加工具集
  • 支持自定义前缀
  • 原生 API 代理

Customize

  // src/prefixer.ts
  const PREFIX_STR = '/you_prefixer'
  $ pnpm build
  $ npm login
  $ pnpm publish

API

prefixerStr(inputStr: string)

返回一个带有前缀的字符串

prefixerStr(); // /your-prefix
prefixerStr('/api'); // /your-prefix/api

$fetch(nput: RequestInfo | URL, init?: RequestInit | undefined)

使用同 window.fetch

$open( url: string | URL | undefined, target?: string | undefined, features?: string | undefined,)

使用同 window.open

$location

代理 window.locationhref 属性和 replace 方法

registerWindow

注册 $fetch,$open$location 到 window

// src/index.js
import { registerWindow } from '@web-common/auto-prefixer';

const App = () => {
  registerWindow();
  return <Element></Element>;
};

Readme

Keywords

Package Sidebar

Install

npm i @zlicom/auto-prefixer

Weekly Downloads

0

Version

0.0.5

License

ISC

Unpacked Size

4.67 kB

Total Files

4

Last publish

Collaborators

  • tototi98