GithubHelp home page GithubHelp logo

cipengxu / mini-ali-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alibaba-mp/mini-ali-ui

0.0 0.0 0.0 1.32 MB

阿里小程序扩展组件

Home Page: https://opendocs.alipay.com/mini/component-ext/ui-overview

License: MIT License

JavaScript 1.73% TypeScript 32.54% Less 65.73%

mini-ali-ui's Introduction

Mini Ali UI

npm package GitHub stars GitHub forks NPM downloads GitHub issues GitHub license

示例

特性

  • 基于 Alipay Design 设计规范;
  • 支持多端小程序(支付宝,淘宝,钉钉等);
  • 支持主题配置切换;
  • 支持 pxrpx

安装

$ npm install mini-ali-ui --save

同时,我们提供了 rpx 版本的 mini-ali-ui,如需要使用 rpx 作为单位的组件,可以通过下述方式进行安装:

$ npm install mini-ali-ui-rpx --save

使用

在页面 json 中文件中进行注册,如 title 组件的注册如下所示:

{
  "usingComponents": {
    "title": "mini-ali-ui/es/title/index"
  }
}

如安装的是 rpx 版本的 mini-ali-ui,那么在进行组件注册时,修改一下名称即可,方式如下:

{
  "usingComponents": {
    "title": "mini-ali-ui-rpx/es/title/index"
  }
}

组件注册成功之后,具体的使用方式无差别。

在 axml 文件中进行调用:

<title
  hasLine="true"
  iconURL="https://t.alipayobjects.com/images/T1HHFgXXVeXXXXXXXX.png"
  type="close"
  onActionTap="titleClose"
>内部标题可关闭</title>

详细使用说明请参照官方文档使用自定义组件

国际化多语种的支持

对组件内部的文案进行梳理,将内部的文案提取后,并翻译。目前支持的语种如下:

默认为中文

使用方式

在小程序中如需要使用非中文语种时,需要在 app.js 中的 globalData 加入指定 key 和 value。

key value
miniAliUiLang ''、'en-US'

miniAliUiLang 为空或者未定义,将作为以中文展示组件内部的默认文案。

App({
  globalData: {
    miniAliUiLang: 'en-US',
  },
  onLaunch() {},
});

贡献

如果你有好的意见或建议,欢迎给我们提 issue

钉钉群

钉钉群:30147295 群号:30147295

链接

mini-ali-ui's People

Contributors

linxz avatar fleksin avatar doxiaodong avatar simplyme0823 avatar superraytin avatar 372623460jh avatar shanxiaohan avatar dorapocket avatar imgss avatar nicoley77 avatar iweb-wiki avatar fisherspy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.