zoukankan      html  css  js  c++  java
  • conditions条件判断

    conditions可以根据条件绑定样式或者数据

    type ==、!=、
    left 条件左值
    right 条件右值
    executionType 条件执行类型,支持 0 和 1 两个值。0 标识该条件满足并执行后跳出条件列表,1 表示当前条件满足并执行后不跳出条件列表,继续向下执行。默认情况是0,即到某个条件满足并执行后即跳出条件列表。

    单个条件:

    <condition type="==" left="$mk_margin" right="4"><styleBinding height="32" /></condition>

    且:

    <andCondition>
        <condition type="==" left="$mk_margin" right="9"/>
        <condition type="!=" left="$diy_margin" right="null"/>
        <styleBinding height="$diy_margin" />
    </andCondition>

    完整实例:

    <ui>
      <view>
        <container>
          <editProperty>
            <dataDefines>
              <dataDefine name="mk_margin" type="select" propertyName="模块下边距">  
                <config type="sync">
                   <data text="8" value="1" defaultSelect="true" />
                   <data text="32" value="4" defaultSelect="false" />
                   <data text="自定义" value="9" defaultSelect="false" />
               </config>
           </dataDefine>
           <dataDefine type="text" propertyName="自定义边距" name="diy_margin" refer="mk_margin:9" isNull="true"/>
       </dataDefines>
    </editProperty>
    <subViews>
     <container>
       <layout type="linearLayout"/>
       <!--默认边距为8-->
       <styleBinding width="640" height="8" backgroundColor="#ff0000" marginTop="0"/>
        <!--条件判断-->
       <conditions>
        <!--如果下拉菜单值为9且自定义边距不为空,则高度为自定义高度-->
          <andCondition>
            <condition type="==" left="$mk_margin" right="9"/>
            <condition type="!=" left="$diy_margin" right="null"/>
            <styleBinding height="$diy_margin" />
        </andCondition>
         <!--如果下拉菜单值为4,则高度为32-->
        <condition type="==" left="$mk_margin" right="4"><styleBinding height="32" /></condition>
    </conditions>   
    </container>    
    </subViews>
    </container>
    </view>
    </ui>
  • 相关阅读:
    Javascript中对文字编码的三个函数
    Web.config文件中关于Cookie安全性的考量和设置
    面试时被问到的问题
    JQuery中查找父元素,子元素,追加元素,插入元素和删除元素 及其他常用方法
    JQuery插件开发学习
    Umbraco image中使用Crop URL
    SQL中的row_number() over()解释
    GEO,IGSO,MEO,LEO
    计算机网络端口常识
    VMnet1和VMnet8 未识别的网络的解决方法
  • 原文地址:https://www.cnblogs.com/tinyphp/p/13593735.html
Copyright © 2011-2022 走看看