国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

uniapp界面新增水印實(shí)現(xiàn)示例詳解

瀏覽:5日期:2022-06-13 11:54:11
目錄正文界面引入組件實(shí)現(xiàn)思路實(shí)現(xiàn)代碼正文

界面引入組件<templeate><view> <Ywatermark :info=''這里是水印內(nèi)容''></Ywatermark></view></tempate><script>import Ywatermark from '@/components/Ywatermark/Ywatermark' //引入組件 export default { data() {}}, components:{ Ywatermark //注冊組件 }</script>實(shí)現(xiàn)思路

首先需要一個(gè)透明蒙版蓋住頁面,然后將水印信息循環(huán)展示出來,展示完成后將蒙版旋轉(zhuǎn)傾斜,然后為了讓水印不影響下層頁面功能的正常使用,需要使用pointer-events: none;屬性讓事件穿透到下面去

實(shí)現(xiàn)代碼<template> <view class='make'><view class='list'> <view v-for='i in 500'><text>{{info}}</text> </view></view> </view></template><script> export default {name: 'watermark',props: { info: {type: String,default: '全局水印' }},data() { return { };} }</script><style lang='scss' scoped> .make {position: fixed;width: 100%;height: 100%;top: 0;left: 0;z-index: 9999;background: rgba(0, 0, 0, 0);pointer-events: none;.list { width: 500%; height: 400%; position: absolute; top: -50%; left: -50%; transform: rotate(-45deg); display: flex; flex-wrap: wrap; justify-content: space-between; pointer-events: none; .item {font-size: 28px;color: rgba(220, 220, 220, 0.3);font-weight: bold;padding: 30rpx;pointer-events: none; }} }</style>

以上就是uniapp界面新增水印實(shí)現(xiàn)示例的詳細(xì)內(nèi)容,更多關(guān)于uniapp界面新增水印的資料請關(guān)注好吧啦網(wǎng)其它相關(guān)文章!

標(biāo)簽: JavaScript
主站蜘蛛池模板: 柳州市| 隆安县| 伊宁市| 广元市| 郴州市| 昭觉县| 广安市| 青阳县| 海原县| 新巴尔虎右旗| 鄯善县| 吉安市| 沙河市| 海伦市| 新平| 盘山县| 农安县| 河池市| 崇明县| 宁津县| 广昌县| 融水| 哈密市| 永泰县| 江津市| 寿阳县| 洱源县| 延寿县| 宜兰市| 泗阳县| 绥德县| 松原市| 耒阳市| 曲麻莱县| 亚东县| 壶关县| 东乡| 镇远县| 成都市| 唐山市| 鲜城|