提交 6668d608 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新CSS示例

上级 b97f342e
<template> <template>
<view style="flex-grow: 1;"> <view style="flex-grow: 1;">
<view class="common" style="background-color: red;z-index: 10;"> <view>
<text>z-index: 10</text> <view class="common fixed" style="background-color: red;z-index: 10;">
<text>position: fixed</text>
<text>z-index: 10</text>
</view>
<view class="common fixed" style="background-color: green;z-index: 5;top: 175rpx;left: 175rpx;">
<text>position: fixed</text>
<text>z-index: 5</text>
</view>
</view> </view>
<view ref="view" class="common" style="background-color: green;transform: translate(125rpx, -125rpx);z-index: 5;" <view style="top: 500rpx;">
@click="changeZIndex(20)"> <view class="common" style="background-color: red;z-index: 10;">
<text>z-index: {{zIndex}}</text> <text>z-index: 10</text>
<text>点击修改z-index</text> </view>
</view> <view ref="view" class="common" style="background-color: green;z-index: 5;top: -75rpx;left: 175rpx;"
<view class="common" style="background-color: blue;transform: translate(250rpx, -250rpx);"> @click="changeZIndex(20)">
<text>z-index: 0</text> <text>z-index: {{zIndex}}</text>
<text>点击修改z-index</text>
</view>
<view class="common" style="background-color: blue;top: -150rpx;left: 350rpx;">
<text>z-index: 0</text>
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -37,4 +49,8 @@ ...@@ -37,4 +49,8 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
</style>
\ No newline at end of file .fixed {
position: fixed;
}
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册