6 text、view

<view>
    <view>
      <text>语文数学</text>
    </view>
   <view>
<text selectable>语文数学</text>
   </view>
   <view>
      <text selectable space="ensp">语文    数学</text>
    </view>
   <view>
     <text selectable space="emsp" >语文    数学</text>
   </view>
   <view>
     <text selectable space="nbsp" style="font-size:100px;">语文    数学</text>
   </view>     
</view>

text标签:

   相当于HTML中的span标签,行内元素,不会换行,且设置宽度不起作用。

1、selectable: 文字是否可以被选中

2、space: 空格。 其中nbsp是以字体的大小为标准决定所占空白区域的大小。

3、decode :  解码

 

view标签:   

   相当于HTML中的div。块级元素,会换行。

1、hover-class: 元素按下去后的样式。 hover-class="class名"  当hover-class="none",没有点击效果

2、hover-stop-propagation: 阻止冒泡,即阻止本节点的父节点出现点击状态。

3、hover-start-time: 点击多久后效果开始,单位毫秒。

4、hover-stay-time: 点击后效果维持多久后消失,单位毫秒。

<template>
    <view class="box1" hover-class="box1-hover">
        <view class="box" hover-class="box-hover" hover-stop-propagation 
        :hover-start-time="2000"
        :hover-start-time="2000"
        >hover-class</view>
        <!-- hover-stop-propagation:阻止冒泡 -->
    </view>
</template>
<style>
    .box{width:100px;height:100px;background:red;}
    .box-hover{background:pink;}
    .box1{width:200px;height:200px;background:blue;}
    .box1-hover{background:#aec7e1;}
</style>

 

posted @ 2021-03-10 22:33  云里知音  阅读(66)  评论(0)    收藏  举报