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

网站有pc站和手机站seo教程培训班

网站有pc站和手机站,seo教程培训班,wordpress实现分享,网站被黑了多久恢复文章目录 v-bind对样式控制的增强2.1 操作class2.1.1 语法2.1.2 对象语法2.1.3 数组语法2.1.4 使用2.1.5 Test 2.2 操作style2.2.1 语法2.2.2 使用2.2.3 Test v-bind对样式控制的增强 2.1 操作class 2.1.1 语法 <div> :class "对象/数组">这是一个div&l…

文章目录

  • v-bind对样式控制的增强
    • 2.1 操作class
      • 2.1.1 语法
      • 2.1.2 对象语法
      • 2.1.3 数组语法
      • 2.1.4 使用
      • 2.1.5 Test
    • 2.2 操作style
      • 2.2.1 语法
      • 2.2.2 使用
      • 2.2.3 Test

v-bind对样式控制的增强

2.1 操作class

2.1.1 语法

<div> :class = "对象/数组">这是一个div</div>

2.1.2 对象语法

当class动态绑定的是对象时,键就是类名,值就是布尔值,如果值是true,就有这个类,否则没有这个类

<div class="box" :class="{ 类名1: 布尔值, 类名2: 布尔值 }"></div>

适用场景:一个类名,来回切换

2.1.3 数组语法

当class动态绑定的是数组时 → 数组中所有的类,都会添加到盒子上,本质就是一个 class 列表

<div class="box" :class="[ 类名1, 类名2, 类名3 ]"></div><div class="box" :class="[ '类名1', '类名2', '类名3' ]"></div>

使用场景:批量添加或删除类

2.1.4 使用

<style>.box {width: 50px;height: 50px;border: 1px solid #000;margin-top: 5px;}.red {background-color: red;}.big {width: 100px; height: 100px;}</style>
</head>
<body><div id="app"><div class="box" :class="{ big: true, red: true }">你好Java</div><div class="box" :class="['red', 'big']">你好Java</div></div><script src="js/vue.js"></script><script>const app = new Vue({el: '#app',data: {}})</script>
</body>

2.1.5 Test

<style>* {margin: 0;padding: 0;}ul {display: flex;border-bottom: 2px solid #1e3c9f;padding: 0 10px;}li {width: 100px;height: 50px;line-height: 50px;list-style: none;text-align: center;}li a {display: block;text-decoration: none;font-weight: bold;color: #333333;}li a.active {background-color: #12e06f;color: #fff;}</style>
</head>
<body><div id="app"><ul><li v-for="(item ,index) in list" :key="item.id" @click="activeIndex = index"><a href="#" :class="{active: index === activeIndex}">{{item.name}}</a></li></ul></div><script src="js/vue.js"></script><script>const app = new Vue({el: '#app',data: {activeIndex: 0, // 记录高亮list: [{id: 1,name: '商品秒杀'}, {id: 2,name: '特价处理'}, {id: 3,name: '品牌优惠'}]}})</script>
</body>

2.2 操作style

2.2.1 语法

:style中的css属性会覆盖 class="box"的css样式

<div class="box" :style="{ CSS属性名1: CSS属性值, CSS属性名2: CSS属性值 }"></div>

2.2.2 使用

<style>.box {width: 50px;height: 50px;background-color: red;}</style>
</head><body><div id="app"><div class="box" :style="{ width: '100px', height: '100px', backgroundColor: 'green' }"></div></div><script src="js/vue.js"></script><script>const app = new Vue({el: '#app',data: {}})</script>
</body>

2.2.3 Test

 <style>.progress {height: 25px;width: 400px;border-radius: 15px;background-color: #272425;border: 3px solid #272425;box-sizing: border-box;margin-bottom: 30px;}.inner {width: 50%;height: 20px;border-radius: 10px;text-align: right;position: relative;background-color: #409eff;background-size: 20px 20px;box-sizing: border-box;transition: all 1s;}.inner span {position: absolute;right: -20px;bottom: -25px;}</style>
</head><body><div id="app"><!-- 外层盒子底色 (黑色) --><div class="progress"><!-- 内层盒子 - 进度(蓝色) --><div class="inner" :style="{ width: percent+'%' }"><span>{{ percent }}%</span></div></div><button @click="percent = 25">设置25%</button><button @click="percent = 50">设置50%</button><button @click="percent = 75">设置75%</button><button @click="percent = 100">设置100%</button></div><script src="js/vue.js"></script><script>const app = new Vue({el: '#app',data: {percent: 30}})</script>
</body>
http://www.hengruixuexiao.com/news/40293.html

相关文章:

  • 对网站建设功能的情况说明最新的全国疫情
  • 海口做网站公司西安seo服务外包
  • 做网站怎样收费的山西seo排名
  • 中国做健身补剂的网站快手流量推广网站
  • 网站搭建阿里在线客服
  • 仙游有人做网站弹窗广告最多的网站
  • 宣传网站怎么做如何进行搜索引擎营销
  • 做空港币人民币网站沈阳今天刚刚发生的新闻
  • 适合个人做的网站有哪些seo推广是什么工作
  • 做网站多少钱_西宁君博优选搜索排行榜
  • 做影视网站对服务器要求守游网络推广平台登陆
  • 游戏网站建设策划方案模板如何做公司网站推广
  • 网上购物网站开发开题报告百度搜索一下就知道
  • 太原做网站找谁南通网络推广
  • 山东网站建设企业自动点击器
  • 做php网站开发能赚钱吗软文范例大全100
  • 网站模版 模板google浏览器官网下载
  • 做女装代理需要自建网站么企业推广方案
  • 文化礼堂建设情况网站搜盘网
  • 商务网站开发的基本原则网页设计网站
  • 南宁比较有好的网站制作公司李勇seo的博客
  • 郑州做网站优化的公司六年级上册数学优化设计答案
  • 怎么建立滚动网站网推怎么做最有效
  • wordpress网站文件管理推广神器
  • 网站建设用啥技术杭州seo联盟
  • wordpress外联css百度seo网站优化
  • 68设计网站搜索引擎算法
  • ssh框架可以做网站么百度seo优化分析
  • 温州做网站公司有哪些排名前十的小说
  • 花生壳 做网站seo每日一帖