微信小程序-基本操作

时间:2023-04-12 阅读:282 评论:0 作者:xirui

App.json

 

  "window": {

    "backgroundTextStyle": "light",

    "navigationBarBackgroundColor": "#00BFFF",

    "navigationBarTitleText": "我爱视听-有声绘本",

    "navigationBarTextStyle": "white"

  },

 

插入图片 index.wxml

<navigator  url='http://www.baidu.com' hover-class="changestyle" >

     <image src='http://35.241.107.185/story/storyimages/sunwukongdanaotiangong.png'></image>

     <view>孙悟空大闹天宫</view>

</navigator>

 

插入图片 index.wxss

 

/**index.wxss**/

.userinfo {

  display: flex;

  flex-direction: column;

  align-items: center;

}

 

.userinfo-avatar {

  width: 128rpx;

  height: 128rpx;

  margin: 20rpx;

  border-radius: 50%;

}

 

 

 

 

.userinfo-nickname {

  color: #aaa;

}

 

.usermotto {

  margin-top: 200px;

}

 

 

.lianjie{

  width: 32.8%;  

  height: 185px;  

  display: inline-block;   

  background-color: #ffffff; 

  margin-left: 0.2%;    

}

 

.story-images{

   width:210rpx;           

   height: 150px;      

   margin-top:10px;

   margin: 15rpx;   

   border: 1px solid rgb(250, 250, 250); 

 }

 

.font{

font-size: 14px;      

height: 20px;          

text-align: center;     

line-height: 1px;     

}

 

 

 

1.空格,换行

 

<text>你好!\t七月流火啊!\n我在下一行</text>

 

\t空格(多个只会显示一个空格)

 

\n换行

 

2.连续空格

 

<view> 

 

    <text space="ensp">你好 啊 哈哈哈(空格是中文字符一半大小)</text>

 

</view>

 

<view> 

 

    <text space="emsp">你好 啊 哈哈哈(空格是中文字符大小)</text> 

 

</view>

 

<view> 

 

    <text space="nbsp">你好 啊 哈哈哈(空格根据字体设置)</text>

 

</view>

 

 

 

<view>

 

    <text decode="{{true}}">你好&ensp;啊&ensp;&ensp;&ensp;哈哈哈(空格是中文字符一半大小)</text>

 

</view>

 

<view>

 

   <text decode="{{true}}">你好&emsp;啊&emsp;&emsp;&emsp;哈哈哈(空格是中文字符大小)</text>

 

</view>

 

<view>

 

    <text decode="{{true}}">你好&nbsp;啊&nbsp;&nbsp;&nbsp;哈哈哈(空格根据字体设置)</text>

 

</view>


本文链接: https://www.5240.net/?id=34 转载请注明出处!