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

做网站这么做哪里注册域名最便宜

做网站这么做,哪里注册域名最便宜,哪个网站可以免费做H5,虫部落是谁做的网站往期内容 《Vue零基础入门教程》第六课:基本选项 《Vue零基础入门教程》第八课:模板语法 《Vue零基础入门教程》第九课:插值语法细节 《Vue零基础入门教程》第十课:属性绑定指令 《Vue零基础入门教程》第十一课:事…

 往期内容

《Vue零基础入门教程》第六课:基本选项

《Vue零基础入门教程》第八课:模板语法

《Vue零基础入门教程》第九课:插值语法细节

《Vue零基础入门教程》第十课:属性绑定指令

《Vue零基础入门教程》第十一课:事件绑定指令

《Vue零基础入门教程》第十二课:双向绑定指令

《Vue零基础入门教程》第十三课:条件渲染

《Vue零基础入门教程》第十四课:列表渲染

1) 什么是样式绑定

通过绑定class属性 或者 style属性 修改样式

2) 绑定class属性

常见有两种语法

  • 数组写法
  • 对象写法

示例

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Document</title><script src="../node_modules/vue/dist/vue.global.js"></script><style>.red {color: red;}.blue {color: skyblue;}</style></head><body><div id="app"><!-- 原生的写法 --><span class="red blue">一段文字</span><!-- 绑定class属性 -- 对象的写法 --><span :class="obj">对象的写法</span><!-- 绑定class属性 -- 数组的写法(推荐) --><span :class="arr">数组的写法</span><span :class="foo">绑定一个变量</span><span :class="flag ? 'red' : 'blue'">使用表达式</span></div><script>const { createApp } = Vueconst vm = createApp({data() {return {obj: {red: true,blue: true,},arr: ['red', 'blue'],foo: 'red',flag: true,}},}).mount('#app')</script></body>
</html>

3) 绑定style属性

对象写法

示例

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Document</title><script src="../node_modules/vue/dist/vue.global.js"></script></head><body><div id="app"><!-- 原生的写法 --><div style="font-size: 32px; color: red">原生的写法</div><!-- 绑定style属性 -- 对象写法 --><div :style="obj">对象的写法</div></div><script>const { createApp } = Vueconst vm = createApp({data() {return {obj: {// 'font-size': '32px',fontSize: '32px',color: 'red',},}},}).mount('#app')</script></body>
</html>

4) 作业
💡 需求
实现京东tab栏切换

GIF.gif

参考答案

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Document</title><!-- 1.1 引入vue.js --><script src="../node_modules/vue/dist/vue.global.js"></script><!-- 2.2 实例静态页面(CSS部分) --><style>* {margin: 0;padding: 0;}li {list-style: none;}.menu-tab {display: flex;justify-content: space-between;margin: 50px auto;height: 40px;width: 700px;border: 1px solid #eee;border-bottom: 1px solid #e4393c;background-color: #f7f7f7;box-sizing: border-box;}.menu-tab .menu-item {flex: 1;display: flex;justify-content: center;align-items: center;font-size: 14px;color: #666;cursor: pointer;}.menu-tab .menu-item:hover {color: #e4393c;}.menu-tab .menu-item.current {color: #fff;background-color: #e4393c;}</style></head><body><!-- 1.2 编写页面容器 --><div id="app"><!-- 2.1 实例静态页面(HTML部分) --><ul class="menu-tab"><!-- <liv-for="(item, index) in items"class="menu-item":class="index == active ? 'current' : '' "@click="active = index"> --><liv-for="(item, index) in items"class="menu-item":class="index == active ? 'current' : '' "@click="handleClick(index)">{{item}}</li></ul></div><!-- 1.3 创建vue实例对象 --><script>const { createApp } = Vueconst vm = createApp({data() {return {items: ['商品介绍', '规格与包装', '售后保障', '商品评价(2000+)', '手机社区'],active: 0,}},methods: {handleClick(i) {console.log(i)this.active = i},},}).mount('#app')</script></body>
</html>

http://www.shuangfujiaoyu.com/news/20868.html

相关文章:

  • 珠海做网站费用新软件推广平台
  • 帝国和织梦哪个做网站好seo工具查询
  • 微信网站如何做网络推广竞价是什么
  • 导航网站开发工具怎么让网站快速收录
  • 东城响应式网站建设营销策略有哪些
  • 做网站设计的提成点是多少360竞价推广登录入口
  • 一个独立IP做几个网站比较合适怎么做网络营销推广
  • 用discuz做的网站广州广告公司
  • 廊坊建设部网站网页
  • pc网站开发微信支付媒体代发网站
  • 大学关工委加强自身建设网站宣传营销顾问
  • 杭州网站建设 巴零网站seo搜索引擎优化怎么做
  • 网站建设工作进度域名备案查询系统
  • 企业网站备案座机号搜索引擎排名google
  • 单页的网站怎么做的常用的网络推广的方法有哪些
  • 百度收录删除旧网站百度推广费2800元每年都有吗
  • eclipse jsp 网站开发seowhy
  • wordpress smtp host云南优化公司
  • 嘉兴做网站中国万网官网
  • 深圳做商城网站百度推广后台管理
  • 触摸屏网站如何做seo搜索排名优化是什么意思
  • 如何做一元购物网站推广放单平台
  • 重庆网站建设找重庆万为今日新闻快讯10条
  • 单页网站做淘宝客搜索大全引擎
  • 如何在jsp上做网站页面代码怎么把广告发到各大平台
  • 外贸进出口公司是干什么的搜索引擎优化的基本手段
  • 顺德网站建设收费标准十大基本营销方式
  • 内网网站如何建设方案宣传推广文案
  • 可信的免费网站建设典型十大优秀网络营销案例
  • 自助建站还是人工建站好简单网页制作模板