0.0.1 • Published 6 years ago

tsweex-x v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Weex Ui

Build Status GitHub last commit npm NPM downloads GitHub closed issues Accessibility Join the chat at https://gitter.im/alibaba-weex-ui/chat

A rich interaction, lightweight, high performance UI library based on Weex.

Demo

Try it with FliggyTaobaoTmallWeex Playground or any browsers now!   简体中文>>

Installation

npm i weex-ui -S

Usage

<template>
  <div>
    <wxc-button text="Open Popup"
                @wxcButtonClicked="buttonClicked">
    </wxc-button>
    <wxc-popup width="500"
               pos="left"
               :show="isShow"
               @wxcPopupOverlayClicked="overlayClicked">
    </wxc-popup>
  </div>
</template>

<script>
  import { WxcButton, WxcPopup } from 'weex-ui';
  // or
  // import WxcButton from 'weex-ui/packages/wxc-button';
  // import WxcPopup from 'weex-ui/packages/wxc-popup';
  module.exports = {
    components: { WxcButton, WxcPopup },
    data: () => ({
      isShow: false
    }),
    methods: {
      buttonClicked () {
        this.isShow = true;
      },
      overlayClicked () {
        this.isShow = false;
      }
    }
  };
</script>

Used together (recommend)

import { WxcComponent1, WxcComponent2 } from "weex-ui"

In order not to pack all the components, you can use babel-plugin-component import specified component.

npm i babel-plugin-component -D
// add a plugins setting to .babelrc
{
  "plugins": [
    [
      "component",
      {
        "libraryName": "weex-ui",
        "libDir": "packages"
      }
    ]
  ]
}

Used separately

import WxcComponent1 from "weex-ui/packages/wxc-component1"
import WxcComponent2 from "weex-ui/packages/wxc-component2"

Weex-toolkit

If you use weex-toolkit to develop a Weex project, Please add 'state-0' and 'babel-plugin-component' to .babelrc.

weex update weexpack
npm i babel-preset-stage-0 babel-plugin-component  -D
{
  "presets": ["es2015", "stage-0"],
  "plugins": [
    [
      "component",
      {
        "libraryName": "weex-ui",
        "libDir": "packages"
      }
    ]
  ]
}

More

  • If webpack.config.js babel-loader has a exclude for node_modules, Please turn on for week-ui exclude: /node_modules(?!\/.*(weex).*)/.
  • You can find more examples here. Write once and support iOS / Android / Html5 right now!

Document

NameCategoryDescription
wxc-buttonLayoutBasic button
wxc-cellLayoutCell layout element
wxc-ep-slider *LayoutCool slider neighbor
wxc-lightboxLayoutPicture list full screen display
wxc-overlayLayoutBasic monlayer element
wxc-popupLayoutPopup box
wxc-resultLayoutGeneral results page
wxc-slide-navLayoutIncreases view windows
wxc-minibarNavigatorTop navigation
wxc-tab-barNavigatorTab bar switching component
wxc-tab-page *NavigatorSingle page Tab switching component
wxc-checkboxData EntryCheckbox list
wxc-countdownData EntryCountdown component
wxc-radioData EntryRadio list
wxc-slider-bar *Data EntrySliding select data
wxc-stepperData EntryQuantity changer
wxc-searchbarData EntrySearch bar component
wxc-grid-selectData DisplayGrid selection component
wxc-indexlistData DisplayIndex list component
wxc-page-calendarData DisplayFull page calendar
wxc-rich-textData DisplayDynamic template
wxc-simple-flowData DisplaySimple flow chart
wxc-tagData DisplayVarious forms of tag
wxc-dialogFeedbackSecond confirmation window
wxc-loadingFeedbackContent load reminder
wxc-maskFeedbackIntermediate popup panel
wxc-noticebarFeedbackMessage prompt bar component
wxc-progressFeedbackProgress bar
wxc-lottery-rainGameCat-cat game
utilsServiceCommon function

Development

npm i
npm run start

Once it has been compiled, a browser window will be opened automatically. You can switch to developer mode to see the demo. And there will be a QR code that you can use to try the demo on your phone in the console.

Support

  • Use it with NPM.
  • Star it if you like.
  • If you have any ideas or suggestions to improve Weex Ui, welcome to submit a PR.
  • Having a problem getting something to work or want to know why we setup something in a certain way? File a GitHub Issue.

License

  • The MIT License
  • Please feel free to use and contribute to the development.