当前位置: 首页 > news >正文

搜索引擎找不到的网站国外app模板下载网站

搜索引擎找不到的网站,国外app模板下载网站,企业年金个人查询官网,室内设计工作室在 Vue 项目中添加水印可以通过以下几种方式实现#xff1a; 方法一#xff1a;使用 CSS 直接通过 CSS 的 background 属性实现水印#xff1a; 实现步骤 在需要添加水印的容器中设置背景。使用 rgba 设置透明度#xff0c;并通过 background-repeat 和 background-size…在 Vue 项目中添加水印可以通过以下几种方式实现 方法一使用 CSS 直接通过 CSS 的 background 属性实现水印 实现步骤 在需要添加水印的容器中设置背景。使用 rgba 设置透明度并通过 background-repeat 和 background-size 实现重复。 示例代码 templatediv classwatermark-containerp这是带水印的内容。/p/div /templatestyle .watermark-container {position: relative;width: 100%;height: 200px;background-color: #f0f0f0;background-image: url(data:image/svgxml;utf8,svg xmlnshttp://www.w3.org/2000/svg width200 height200text x20 y100 font-size20 fillrgba(0,0,0,0.2) transformrotate(-45)Watermark/text/svg);background-repeat: repeat; } /style方法二通过 Canvas 动态生成水印 使用 Canvas 动态生成水印并将其作为背景图应用。 实现步骤 在 Vue 中创建一个方法通过 canvas 动态生成水印图。将生成的图像作为背景图应用到需要添加水印的元素上。 示例代码 templatediv classwatermark-container :style{ backgroundImage: watermark }p这是带水印的内容。/p/div /templatescript export default {data() {return {watermark: ,};},mounted() {this.generateWatermark();},methods: {generateWatermark() {const canvas document.createElement(canvas);const ctx canvas.getContext(2d);canvas.width 200;canvas.height 200;ctx.font 20px Arial;ctx.fillStyle rgba(0, 0, 0, 0.2);ctx.textAlign center;ctx.textBaseline middle;ctx.translate(100, 100);ctx.rotate((-45 * Math.PI) / 180);ctx.fillText(Watermark, 0, 0);this.watermark url(${canvas.toDataURL(image/png)});},}, }; /scriptstyle .watermark-container {position: relative;width: 100%;height: 200px;background-repeat: repeat; } /style方法三封装水印组件 如果需要复用可以封装一个通用的水印组件。 示例代码 templatediv classwatermark :style{ backgroundImage: watermark }slot/slot/div /templatescript export default {props: {text: {type: String,default: Watermark,},fontSize: {type: String,default: 20px,},color: {type: String,default: rgba(0, 0, 0, 0.2),},rotate: {type: Number,default: -45,},},data() {return {watermark: ,};},mounted() {this.generateWatermark();},methods: {generateWatermark() {const canvas document.createElement(canvas);const ctx canvas.getContext(2d);canvas.width 200;canvas.height 200;ctx.font ${this.fontSize} Arial;ctx.fillStyle this.color;ctx.textAlign center;ctx.textBaseline middle;ctx.translate(100, 100);ctx.rotate((this.rotate * Math.PI) / 180);ctx.fillText(this.text, 0, 0);this.watermark url(${canvas.toDataURL(image/png)});},}, }; /scriptstyle .watermark {position: relative;width: 100%;height: 100%;background-repeat: repeat; } /style使用 templatedivWatermark textConfidential colorrgba(255,0,0,0.1)p这是机密内容。/p/Watermark/div /templatescript import Watermark from ./Watermark.vue;export default {components: {Watermark,}, }; /script以上方法可以根据需求选择适合的方式实现水印效果。
http://www.dnsts.com.cn/news/146425.html

相关文章:

  • 网站php源码wordpress ping服务列表
  • 网站建设1000字深圳网络营销怎么推广
  • 深圳做网站的好公司建模网站素材
  • 怎么做网赌网站服务器主机如何搭建wordpress
  • 网站原型线上平台运营方案
  • 高端的培训行业网站开发专门做钣金的网站
  • 广告传媒公司网站做网站投广告赚钱么
  • 北京建站公司哪个好定制网站建设托管
  • 免费建站网站一级大录像不卡网站推广的基本方式
  • 马尔康网站建设兰州网站建设科技公司
  • 网站有域名用注册商标吗现在什么语言做网站最好
  • 网站关键词快速排名服务wordpress仿36kr主题
  • 河南郑州旅游网站设计视频播放类网站建设费用
  • wordpress 建站配置有哪些做的比较精美的网站
  • 建设银行网站不能打开网站如何做才会有流量
  • 贵州省建设厅官方网站建筑工程劳务分包平台
  • 南通营销网站开发网页界面设计特点
  • 网站开发课题开发背景网站模板排名
  • 长沙网站seo按天计费公司网站建设策划方案
  • 行业网站建设费用明细嘉定网站建设哪里便宜
  • 网站建设结构安排论文房屋设计师破解版
  • 东丰在线网站建设用于网站建设的费用怎么备注
  • 网站开发那种语言好佛山定制网页设计
  • 金寨县建设局网站百度合伙人官方网站
  • 可以做高中题目的网站网站平台方案设计
  • 网站建设维护工作经验网站设计厂
  • php网站建设填空题织梦网站添加下载
  • 移动网站怎么做的郑州小程序开发公司排名
  • 谷歌网站推广排名工具广州网站定做教程
  • 中国室内设计联盟网优化排名推广教程网站