微信小程序开发之小程序组件使用教程

以下为大家介绍小程序开发过程中,小程序组件的使用教程。小程序组件是小程序开发中非常重要的部分,是开发者必须掌握的技能。

微信小程序开发之小程序组件使用教程

icon

icon组件有3个属性,如下:

  • type,可选值:success, success_no_circle, info, info_circle,warn, waiting, cancel, download, search, clear
  • color,如#C9C9C9。
  • size,默认为23px。

再看具体的wxml和wxss。

<code class="language-wxml hljs fsharp has-numbering"><view class="demo-view-4">
    <view class="view-1">
        <icon class="margin" type="circle">
        <view class="margin">circle:多选未选中</view>
    </icon></view>
    <view class="view-1">
        <icon class="margin" type="success">
        <view class="margin">success:成功或已选中</view>
    </icon></view>
    <view class="view-1">
        <icon class="margin" type="success_no_circle">
        <view class="margin">success_no_circle:单选已选中</view>
    </icon></view>
    <view class="view-1">
        <icon class="margin" type="info">
        <view class="margin">info:信息提示</view>
    </icon></view>
    <view class="view-1">
        <icon class="margin" color="#C9C9C9" type="warn">
        <view class="margin">warn-#C9C9C9:普通警告</view>
    </icon></view>
    <view class="view-1">
        <icon class="margin" type="warn">
        <view class="margin">warn:强烈警告</view>
    </icon></view>
    <view class="view-1">
        <icon class="margin" type="waiting">
        <view class="margin">waiting:等待</view>
    </icon></view>
    <view class="view-1">
        <icon class="margin" type="download">
        <view class="margin">download:可下载</view>
    </icon></view>
    <view class="view-1">
        <icon class="margin" type="info_circle">
        <view class="margin">info_circle:有信息提示</view>
    </icon></view>
    <view class="view-1">
        <icon class="margin" type="cancel">
        <view class="margin">cancel:停止或关闭</view>
    </icon></view>
    <view class="view-1">
        <icon class="margin" type="search">
        <view class="margin">search:搜索</view>
    </icon></view>

    <view class="view-1">
        <icon class="margin" type="clear">
        <view class="margin">clear:删除</view>
    </icon></view>

    <view class="view-1">
        <view class="margin">PS:每个type都可以设置颜色(color),大小(size)</view>

    </view>


</view></code></pre>
<pre class="prettyprint" name="code">
<code class="language-css hljs  has-numbering">.demo-view-4{
    display:flex;
    height: 100%;
    flex-direction: column;
}

.view-1{
    display:flex;
    height: 100%;
    flex-direction: row;
}

.margin{
    margin: 20rpx;
}</code>

text

wxml如下:

<code class="language-xml hljs  has-numbering"><text>My name is wisely。\n I am a Androider!</text></code>

progress

progress组件的属性如下:

属性名 类型 默认值 说明
percent Float 百分比0~100
show-info Boolean false 在进度条右侧显示百分比
stroke-width Number 6 进度条线的宽度,单位px
color Color #09BB07 进度条颜色 (请使用 activeColor)
activeColor Color   已选择的进度条的颜色
backgroundColor Color   未选择的进度条的颜色
active Boolean false 进度条从左往右的动画


【本站声明】
  1、本站文章中所选用的图片及文字来源于网络以及用户投稿,由于未联系到知识产权人或未发现有关知识产权的登记,如有知识产权人并不愿意我们使用,如果有侵权请立即联系。
  2、本网站不对文章中所涉及的内容真实性、准确性、可靠性负责,仅系客观性描述,如您需要了解该类商品/服务详细的资讯,请您直接与该类商品/服务的提供者联系。


KESION 科汛软件

KESION 科汛软件是国内领先的在线教育软件及私域社交电商软件服务提供商,长期专注于为企业提供在线教育软件及社交电商SaaS平台解决方案。
公司核心产品云开店SaaS社交电商服务平台、在线教育SaaS服务平台、教育企业数字化SaaS云平台、企微营销助手、私有化独立部署品牌网校和在线教育咨询等。

KESION 不断通过技术创新,提供产品和服务,助力企业向数字化转型,通过科技驱动商业革新,让商业变得更智慧!



▼点击进入科汛官网了解更多



上/下篇
  • 自定义小程序swiper轮播图面板指示点样式的方法

  • 小程序商城购物车功能开发方法

换一换相关推荐
精选内容
热点精选