Git Product home page Git Product logo

cml-ui's Introduction

cml-ui version

本仓库为 cml 框架的扩展组件库,提供丰富的组件能力

详细见cml扩展组件文档

例如:

<script cml-type="json">
{
  "base": {
      "usingComponents": {
        "c-dialog": "cml-ui/components/c-dialog/c-dialog"
      }
  }
}
</script>

1 如何开发

npm install
cml dev  //开始开发

2 目录概述

.
├── README.md
├── bin
   └── build.sh
├── chameleon.config.js
├── dist
   └── wx
       ├── app.js
       ├── app.json
       ├── app.wxss
       ├── components
       ├── pages
       ├── project.config.json
       └── static
├── mock
   ├── api
      └── index.js
   └── template
       └── index.php
├── package  // build.sh 结果,发布到npm
   ├── assets
      ├── css
      └── images
   ├── components
      ├── c-action-sheet
      └── c-dialog
   └── package.json
├── package-lock.json
├── package.json
└── src  //开发目录
    ├── app
       ├── app.cml
       └── app.interface
    ├── assets
       ├── css
       └── images
    ├── components //开发组件
       ├── c-action-sheet
       └── c-dialog
    ├── entry
       ├── entry.html
       ├── entry.web.js
       └── entry.weex.js
    ├── pages  //组件示例demo页
       ├── API // 相应api 接口demo示例
       ├── COMP //相应组件demo示例;
       └── index  //主页入口
    
    ├── router.js
    ├── router.config.json //路由配置
    └── store
        ├── action-types.js
        ├── actions.js
        ├── getter-types.js
        ├── getters.js
        ├── index.js
        ├── mutation-types.js
        ├── mutations.js
        └── state.js

开发步骤

  1. 查看index.cml文件,大概了解主页的配置和生效路径;
  2. 配置: 只需要在 router.config.json 中配置对应路由页面
  3. 配置完毕之后 在 src/pages/COMP中书写你的demo组件
  4. 当前以上的工作都是为了可以实时查看开发的组件的效果做准备,接下来就需要去src/components中去开发我们对应的组件
  5. enjoy yourself

4 多端预览效果

web 微信小程序 native-weex

cml-ui's People

Contributors

beatles-chameleon avatar jimwmg avatar startheart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cml-ui's Issues

c-popup h5 和 微信小程序里面 显示不一样

<c-popup class="cart-pop" show="{{true}}"  mask="{{true}}" center="{{false}}" position="bottom">
          <view class="cart-form">
            <row justify="start" align="top" margin="{{20}}">
              <col margin="{{50}}">
                <image src="{{'http:' + scene_img_url}}" style="width:180cpx;"></image>
              </col>
              <col margin="{{50}}">
                
                <view class="section-evaluate" style="margin-top:0cpx;">
                  <view class="section-evaluate-info" style="justify-content:center">
                    <text class="section-evaluate-info-name" style="margin-bottom:20cpx;">{{good_name}}</text>
                    <text class="section-evaluate-info-desc" style="color:red;">¥{{money}}</text>
                  </view>
                </view>

              </col>
            </row>

             <row justify="start" margin="{{20}}">
              <col margin="{{50}}">
                <text>购买数量:</text>
              </col>
              <col margin="{{50}}">
                
                <view class="section-evaluate" style="margin-top:0cpx;justify-content:center">
                  <button style="height:auto;line-height:0;" type="white">
                    -
                  </button>
                  <input placeholder='请输入金额' style="width:200cpx;border-radius:0px;"></input>
                  <button style="height:auto;line-height:0;" type="white">
                    +
                  </button>
                </view>

              </col>
            </row>

            <row justify="start" margin="{{20}}" style="flex-direction:column">
              <button type="red">确定</button>
            </row>

          </view>
        </c-popup>

<style scoped>
  .content {
    background: #f4f4f4;
  }

  .carousel-container {
    height: 750cpx;
  }

  .carousel-carousel-item, .Img {
    height: 750cpx;
    width: 750cpx;
  }

  .description {
    width: 750cpx;
    height: 128cpx;
    background-color: #F9F9F9;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-around;
    align-items: center;
  }

  .description-item {
    width: 210cpx;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .description-item-img {
    width: 72cpx;
    height: 72cpx;
    overflow: hidden;
    border-radius: 36cpx;
  }

  .description-item-img-con {
    width: 72cpx;
    height: 72cpx;
  }

  .description-item-des {
    height: 72cpx;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .description-item-des-tag {
    font-size: 28cpx;
    color: #666;
  }

  .section {
    background: #fff;
    padding: 30cpx 0 30cpx 30cpx;
  }

  .class-money {
    color: #B4282D;
    font-size: 50cpx;
    font-weight: bold;
  }

  .section-tag {
    width: 240cpx;
    height: 40cpx;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    border-radius: 6cpx;
    border: 2cpx solid #B4282D;
  }

  .section-tag-con {
    color: #B4282D;
    font-size: 24cpx;
  }

  .section-evaluate {
    margin-top: 20cpx;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }

  .section-evaluate-info {
    width: 550cpx;
    height: 160cpx;
    /*border-right: 2cpx dashed #666;*/
    display: flex;
    justify-content: space-between;
  }

  .section-evaluate-info-name {
    font-size: 34cpx;
    color: #333;
  }

  .section-evaluate-info-desc {
    font-size: 24cpx;
    color: #666666;
  }

  .section-evaluate-number {
    width: 180cpx;
    display: flex;
    justify-content: center;
  }

  .section-evaluate-number-total {
    display: flex;
    justify-content: center;
    text-align: center;
    color: #B4282D;
    font-size: 30cpx;
  }

  .section-evaluate-number-ping {
    display: flex;
    justify-content: center;
    text-align: center;
    color: #666666;
    font-size: 24cpx;
  }

  .coupon {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    background: #ffffff;
    padding: 30cpx 20cpx;
    margin: 15cpx 0;
  }

  .coupon-tag {
    background-image: linear-gradient(90deg, #FF8659 0, #FF2C30 100%);
    font-size: 22cpx;
    color: #ffffff;
    padding: 0 14cpx;
    border-radius: 16cpx;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .coupon-money {
    font-size: 30cpx;
    color: #555555;
    margin-left: 10cpx;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .coupon-get {
    color: #FF2E31;
    font-size: 26cpx;
    padding: 4cpx 16cpx;
    border-radius: 30cpx;
    border: 2cpx solid #FF2E31;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 120cpx;
  }

  .map {
    width: 750cpx;
    height: 350cpx;
  }

  .content-list-item-content-img{
    margin-top:10cpx;
    width:100%;
  }

  .footer{
    display: flex;
    flex-direction: row;
    background: #faf9fa;
  }

  .cart-pop{
    align-self:flex-end
  }

  .cart-form{
    position: rerelative;
    background: #fff;
    padding: 20cpx;
  }

</style>

编译预览异常问题

1、These dependencies were not found
2、Uncaught Error: Cannot find module "chameleon-runtime

【bug】carousel 轮播组件

carousel 轮播组件,在Web端,快速滑动,超出页面边界,JS会报错哈
版本
"chameleon-api": "0.1.0",
"chameleon-bridge": "0.1.0",
"chameleon-runtime": "0.0.3",
"chameleon-store": "0.0.3",
"chameleon-ui-builtin": "0.0.6",
"cml-ui": "0.0.7-alpha"
错误截图
Alt text
Alt text

代码报错的位置
Alt text

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.