小程序全局页面添加水印

35 阅读1分钟
<view class="sy_content">
    <block wx:for="{{30}}" wx:key="index" wx:if="{{userInfo}}">
        <view class="sy_lable">
            {{userInfo.user_name + '  ' + userInfo.user_phone}}      
            {{userInfo.user_name + '  ' + userInfo.user_phone}}     
            {{userInfo.user_name + '  ' + userInfo.user_phone}}    
            {{userInfo.user_name + '  ' + userInfo.user_phone}}
            {{userInfo.user_name + '  ' + userInfo.user_phone}}
        </view>
    </block>
</view

``` /**
     * 组件的初始数据
     */
    data: {
        userInfo:{
            user_name:'张三',
            user_phone:'15099999998'
        }
    },
    position: fixed;
    top: -10vh;
    left: -100vw;
    width: 250vw;
    height: 100vh;
    /* z-index: -999; */
    pointer-events: none;
    transform: rotate(-45deg);
}

.sy_lable {
    color: gray;
    margin: 30rpx;
    padding: 20rpx;
    opacity: 0.15;
}

效果如下

QQ图片20251124115755.png