GithubHelp home page GithubHelp logo

cuitymiko / taro-ui-vue Goto Github PK

View Code? Open in Web Editor NEW

This project forked from psaren/taro-ui-vue

0.0 1.0 0.0 3.86 MB

UI KIT for Taro/vue

License: MIT License

JavaScript 21.44% TypeScript 18.96% HTML 0.25% Vue 27.94% SCSS 31.41%

taro-ui-vue's Introduction

taro-ui-vue

NPM version NPM David npm

项目背景

tarojs 已经开始支持 vue 去写 taro 应用了,由于缺少相关的 ui 库,因此决定 按照 taro-ui 重写成 vue 组件。 形成了 taro-ui-vue 这个库。

相关链接

Taro Ui Vue 使用文档
Taro
Taro Ui

使用注意

Taro Ui Vue 提供的是源文件,源文件部分代码使用 ts 编写,需要项目支持 ts。 如果是用 taro init 命令创建,则需在使用时选择 ts

安装

npm i -S taro-ui-vue

使用

按需引入

// page.js
import { AtButton } from 'taro-ui-vue'
// OR
import AtButton from 'taro-ui-vue/src/components/button/index.vue'

按需引入样式

// js
import 'taro-ui-vue/dist/style/components/tag.scss'
// css
@import "~taro-ui/dist/style/components/button.scss";

示例

<template>
  <view class="index">
    <AtTag>标签</AtTag>
    <AtIcon value="clock" color="#F00"></AtIcon>
  </view>
</template>

<script>
import { AtTag, AtIcon } from 'taro-ui-vue'
import 'taro-ui-vue/dist/style/components/icon.scss'
import 'taro-ui-vue/dist/style/components/tag.scss'
export default {
  name: 'Index',
  components: {
    AtTag,
    AtIcon,
  }
}
</script>

全局引入所有组件

// app.js
import TaroUiVue from 'taro-ui-vue/src'
import 'taro-ui-vue/dist/style/index.scss'
Vue.use(TaroUiVue)

onXXX 属性示例

在 .vue 文件 template 中需要按下面这样写

<template>
  <view>
    <AtTag
      type="primary"
      :on-click="handleClick"
    >
      标签
    </AtTag>
  </view>
</template>

更多使用方式

更多组件使用及属性请参考 taro-ui 使用文档
所有参数基本一致

TODO

  • 为组件添加测试用例

CHANGELOG

CHANGELOG

贡献

如果你在使用 Taro-UI-Vue 时遇到问题,或者有好的建议,欢迎给我们提 Issue 或 Pull Request。在开始之前,请阅读 贡献指南

License

MIT

taro-ui-vue's People

Contributors

psaren avatar b2nil avatar chienslation avatar bwchenxin avatar volcano-yang avatar dependabot[bot] avatar

Watchers

James Cloos 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.