在前端踩过的坑(续更

1.自定义的CSS动态使得它作业区域的所有taiwindcss全部失效(未解决)

 

  <!-- 渐变动画:问题(凡是渐变动画出现的区域,其它JS会全部失效) -->
    <ul class="bg-squares">
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
    </ul>


<style scoped>
/* 背景方块 */
.bg-squares {
  list-style: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.bg-squares li {
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.15);
  position: absolute;
  bottom: -160px;
  /* 执行动画:动画名 时长 线性 无限次播放 */
  animation: square 20s linear infinite;
}
/* 为每一个方块设置不同的位置、大小、动画延迟时间、动画时长、背景色 */
.bg-squares li:nth-child(1) {
  left: 10%;
}
.bg-squares li:nth-child(2) {
  left: 20%;
  width: 80px;
  height: 80px;
  /* 动画延迟时间 */
  animation-delay: 2s;
  /* 动画时长 */
  animation-duration: 17s;
}
.bg-squares li:nth-child(3) {
  left: 25%;
  animation-delay: 4s;
}
.bg-squares li:nth-child(4) {
  left: 40%;
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.25);
  animation-duration: 22s;
}
.bg-squares li:nth-child(5) {
  left: 70%;
}
.bg-squares li:nth-child(6) {
  left: 80%;
  width: 120px;
  height: 120px;
  background-color: rgba(255, 255, 255, 0.2);
  animation-delay: 3s;
}
.bg-squares li:nth-child(7) {
  left: 32%;
  width: 160px;
  height: 160px;
  animation-delay: 7s;
}
.bg-squares li:nth-child(8) {
  left: 55%;
  width: 20px;
  height: 20px;
  animation-delay: 15s;
  animation-duration: 40s;
}
.bg-squares li:nth-child(9) {
  left: 25%;
  width: 10px;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.3);
  animation-delay: 2s;
  animation-duration: 40s;
}
.bg-squares li:nth-child(10) {
  left: 90%;
  width: 160px;
  height: 160px;
  animation-delay: 11s;
}
.container.success h1 {
  transform: translateY(75px);
}
.container.success .form {
  opacity: 0;
  visibility: hidden;
}

/* 定义动画 */
@keyframes square {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-120vh) rotate(600deg);
  }
}
</style>

2.V-for自定义组件失效

    <item-vue v-for="item in blogs" :key="item.id" :data="item"></item-vue>

//获取数据
const blogs = ref([])
const getData = async () => {
  let res = await request({
    url: '/article/2/3',
    method: 'GET'
    //data: { content: '好' }
  })
  console.log('res:', res)
  blogs.value = res.rows//res.rows写错了,导致blogs数据变成未定义的
  console.log('blogs', blogs)
}

3.只展示查询出的数据的一部分

   <p class="card-text text-muted">
        {{ data.content.substring(0, 40) }}
      </p>

.substring()函数

4.TailwindCSS的容器

5.ASNYC的用法和同步异步的区别

6.浅玩一下高斯模糊

 使用了tailwindcss的filter

<div class="filter blur-lg">

</div>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值