「小程序JAVA实战」小程序的基础组件(24)
转自:https://idig8.com/2018/08/12/xiaochengxu-chuji-24/
来说下 ,小程序的基础组件。源码:https://github.com/limingios/wxProgram.git 中的No.11
基础组件
- icon图标组件
- rich-text 富文本组件
- text 文本组件
- progress 进度条组件
icon图标组件
- 官方介绍
>https://developers.weixin.qq.com/miniprogram/dev/component/icon.html

- 演示用例
<!--icon.wxml-->
<view class="container">
<icon type='success' color='red' size='55'></icon>
<icon type='success_no_circle' size='55'></icon>
<icon type='info' size='55'></icon>
<icon type='warn' size='55'></icon>
<icon type='waiting' size='55'></icon>
<icon type='cancel' size='55'></icon>
<icon type='download' size='55'></icon>
<icon type='search' size='55'></icon>
<icon type='clear' size='55'></icon>
</view>

text组件
- 官方介绍
>https://developers.weixin.qq.com/miniprogram/dev/component/text.html

- 演示用例
text.html
<!--text.wxml-->
<view>
<text selectable='{{true}}'>欢迎关注:编程坑太多</text>
</view>
<view>
<text>欢迎关注:编程坑太多</text>
</view>
<view>
<text space='{{true}}' decode="true">个人博客: idig8.com</text>
</view>
<view>
<text space='{{false}}'>个人博客: idig8.com</text>
</view>
<view>
<text decode="true">个人博客:\t\nidig8.com</text>
</view>

rich-text 富文本
- 官方介绍
>https://developers.weixin.qq.com/miniprogram/dev/component/rich-text.html

- 演示用例
rich-text.html
<!--rich-text.wxml-->
<view>
<rich-text nodes="{{mycontentStr}}"> </rich-text>
<rich-text nodes="{{mycontentArray}}"> </rich-text>
</view>
rich-text.js
//rich-text.js
//获取应用实例
const app = getApp()
Page({
data:{
mycontentStr: '<img class="s_lg_img_gold_show" src="//www.baidu.com/img/bd_logo1.png" width="270" height="129" >',
mycontentArray:[
{
name:"img",
attrs:{
class:"s_lg_img_gold_show",
src:"//www.baidu.com/img/bd_logo1.png",
width:"270",
height:"129"
}
}
]
}
})
rich-text.wxss
/**icon.wxss**/
.s_lg_img_gold_show{
width:600rpx;
}

使用富文本需要特别注意

progress 进度条
- 官方介绍
>https://developers.weixin.qq.com/miniprogram/dev/component/progress.html

- 演示用例
rich-text.html
<!--progress.wxml-->
<view>
<progress percent="70" show-info="{{true}}" stroke-width="20" color="red" active="{{true}}"></progress>
<progress percent="{{mypercent}}" show-info="{{true}}" stroke-width="20" color="red" active="{{true}}" active-mode='forwards'></progress>
<view bindtap='addpercent' >增加进度条百分比</view>
</view>
//progress.js
//获取应用实例
const app = getApp()
Page({
data:{
mypercent:15
},
addpercent:function(){
var newpercent = this.data.mypercent+20;
this.setData({
mypercent: newpercent
})
}
})

PS:关于基础组件部分就是这4块,从下次开始咱们一起了解下表单组件
「小程序JAVA实战」小程序的基础组件(24)的更多相关文章
- 「小程序JAVA实战」小程序的表单组件(25)
转自:https://idig8.com/2018/08/18/xiaochengxujavashizhanxiaochengxudebiaodanzujian25/ 来说下 ,小程序的基础组件.源码 ...
- 「小程序JAVA实战」小程序的组件(23)
转自:https://idig8.com/2018/08/11/xiaochengxu-chuji-23/ 开始了解下小程序的组件.源码:https://github.com/limingios/wx ...
- 「小程序JAVA实战」小程序的flex布局(22)
转自:https://idig8.com/2018/08/09/xiaochengxu-chuji-22/ 之前已经把小程序的框架说完了,接下来说说小程序的组件,在说组件之前,先说说布局吧.源码:ht ...
- 「小程序JAVA实战」小程序的留言和评价功能(70)
转自:https://idig8.com/2018/10/28/xiaochengxujavashizhanxiaochengxudeliuyanhepingjiagongneng69/ 目前小程序这 ...
- 「小程序JAVA实战」小程序的举报功能开发(68)
转自:https://idig8.com/2018/09/25/xiaochengxujavashizhanxiaochengxudeweixinapicaidancaozuo66-2/ 通过点击举报 ...
- 「小程序JAVA实战」小程序的个人信息作品,收藏,关注(66)
转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudegerenxinxizuopinshoucangguanzhu65 ...
- 「小程序JAVA实战」小程序的关注功能(65)
转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudeguanzhugongneng64/ 在个人页面,根据发布者个人和 ...
- 「小程序JAVA实战」小程序的视频点赞功能开发(62)
转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudeshipindianzangongnengkaifa61/ 视频点 ...
- 「小程序JAVA实战」小程序的springboot后台拦截器(61)
转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudespringboothoutailanjieqi60/ 之前咱们把 ...
随机推荐
- 【Python】下载图片
import requests import bs4 import urllib.request import urllib import os hdr = {'User-Agent': 'Mozil ...
- .net collection tips
1.数组对象都是Array的子类,Array是一个抽象类,不能显示实例化,Array提供了大量操作数组的静态方法 2.ArrayList其实是内部封装了一个array,实现了IList的接口.add ...
- 通过拖拽prefab来存储相应的路径
更新了一下,支持数组和嵌套数据结构. using UnityEngine; using System.Collections; using UnityEditor; using System.Refl ...
- CODEVS3013 单词背诵 【Hash】【MAP】
CODEVS3013 单词背诵 题目描述 Description 灵梦有n个单词想要背,但她想通过一篇文章中的一段来记住这些单词. 文章由m个单词构成,她想在文章中找出连续的一段,其中包含最多的她想要 ...
- 解决大于 4GB 的 Windows 10 镜像在 UEFI 模式下的安装问题
制作一个 Windows 安装 U 盘是很容易的,使用 UltraISO 这样的刻录工具量产一个 iso 镜像文件到 U 盘即可.然而随着 Windows 10 版本号的提升,镜像变得越来越大,终于 ...
- C#类、方法的访问修饰符
这篇文章主要介绍了C#类的访问修饰符用法,较为详细的分析了C#类的访问修饰符概念与用法,具有一定的参考借鉴价值,需要的朋友可以参考下 本文详细分析了C#类的访问修饰符用法,分享给大家供大家参考.具体用 ...
- c++中子类转父类,父类转子类
#include <iostream> using namespace std; class Father { public: virtual void show() { cout< ...
- php+ajax+jquery 定时刷新页面数据
testajax.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http: ...
- outlook2013插件 VSTO开发与部署
一.背景 最近因为项目需要对outlook开发一个插件,功能是将outlook的邮件作导出功能,需要使用VSTO开发一个插件将邮件进行导出的操作.于是,开始学习VSTO outlook的开发了,折腾了 ...
- ubuntu :扩充虚拟机的磁盘容量
前言: 开始建立虚拟机的时候给的容量是20G,给了10G的交换空间,所以后来有点不够用了,现在安装软件会出现提示磁盘空间不足,所以需要扩充一下磁盘的容量. 步骤: 1.因为我用的是Vmware ...