Uni API is a cross-end API solution that supports small programs and web containers.
? Multi-container support Currently supports Web, WeChat applet, Toutiao applet, Alibaba applet, Baidu applet, Kuaishou applet
? Rich API covering 90+ API implementations
? Complete documentation , providing bilingual documents and rich samples
0️⃣No framework dependencies, no framework dependencies, pure native implementation, compatible with any framework
Extreme size supports on-demand loading and eliminates useless code based on the environment.
?? Easy to use and quick to access. Provides complete TypeScript declarations, allowing you to get rid of documents and immerse yourself in programming.
Take @uni/toast as an example
$ npm install @uni/toast
import { showToast } from '@uni/toast' ;
// string
showToast ( 'Hi' ) ;
// object
showToast ( {
content : 'hello' ,
type : 'success' ,
duration : 1000 ,
success : ( ) => {
console . log ( 'toast' )
}
} ) ;
// promise
showToast ( {
content : 'hello' ,
type : 'success' ,
duration : 1000 ,
} ) . then ( ( ) => { } ) ;
Official site: https://universal-api.js.org/
WeChat applet | Alipay applet |
---|---|
Please first read the Rax Contribution Guidelines to understand the basic specifications.
$ git clone [email protected]:raxjs/universal-api.git
$ yarn
$ yarn build
$ yarn demo:init
$ yarn demo:dev
Then use the mini program IDE to start debugging:
The API package version is uniformly maintained in api-config.js in the root directory, taking @uni/toast as an example:
module . exports = {
toast : {
path : 'src/packages/interactive/toast/src/index.ts' ,
pkgInfo : [
{
version : '1.0.5' ,
name : '@uni/toast' ,
} ,
] ,
} ,
}
parameter | meaning | default value |
---|---|---|
path | The path to the source file | - |
pkgInfo | Attributes of npm package (same writing method as packagejson) | - |
needCommonUtil | Are public utils required? | true |
unNeedSplit | Do you need environmental subcontracting? | false |
The large package version needs to update the version of package.json in the root directory.
BSD License