【前端】一些用法学习记录

document.querySelectorAll() 选取元素列表的用法

      1.获取文档中的所有<p>元素

      var x = document.querySelectorAll("p");

       设置第一个 <p>元素的背景颜色

      x[0].style.backgroundColor = "red";

       获取之后的是一个数组,分别对应文档里的所有<p>元素

    

    2.获取文档中所有 class = example 的 <p> 元素

      var x = document.querySelectorAll("p.example")

    3.获取文档中所有 class = example 的 元素

      var x = document.querySelectorAll(".example")

a标签显示效果

a:link { color: #ffffff; text-decoration: none; } /* 未访问链接 */
a:visited { color: #ffffff; text-decoration: line-through; } /* 已访问链接 */
a:hover { color: #93d7ff; text-decoration: none; }/* 鼠标移动到链接上 */

 

VUE项目部署后,可以看到源代码问题解决  

  需要在config中,配置index.js中的

productionSourceMap: false,
posted @ 2023-02-01 14:44  YanSss  阅读(30)  评论(0编辑  收藏  举报