數(shù)據(jù)綁定實(shí)踐:
頁(yè)面結(jié)構(gòu)
數(shù)據(jù)
綁定數(shù)據(jù)
樣式
樣式
效果圖
//weather.wxml{{temp}} C{{low}}/{{high}}{{type}}{{city}}{{week}}{{weather}}//weather.jsPage({data:{temp:4,low:”-1 C”,high:”10 C”,type:”晴”,week:”星期二”,city:”昆山”,weather:”無(wú)持續(xù)風(fēng)行,微風(fēng)級(jí)”}});//weather.wxss.content{font-family:’微軟雅黑 宋體’;font-size:14px;background-size:cover;height: 100%;width: 100%;color: #333333;}.today{padding-top: 70rpx;height: 50%;}.temp{font-size: 80px;text-align: center;}.city{font-size: 20px;text-align: center;margin-top: 20rpx;margin-right: 10rpx;}.lowhigh{font-size: 12px;text-align: center;margin-top: 30rpx;}.type{font-size: 16px;text-align: center;margin-top: 30rpx;}.week{font-size: 12px;text-align: center;margin-top: 30rpx;}.weather{font-size: 12px;text-align: center;margin-top: 20rpx;}