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

温州网站优化定制腾讯云网站搭建

温州网站优化定制,腾讯云网站搭建,社群推广平台,站群是什么意思看效果图 Vue长相思 刚学Vue&#xff0c;正好在追剧&#xff0c;看到这个小案例觉得挺好玩的&#xff0c;第一天学&#xff0c;代码太简陋了 代码 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name&qu…

看效果图

Vue长相思

在这里插入图片描述



刚学Vue,正好在追剧,看到这个小案例觉得挺好玩的,第一天学,代码太简陋了

代码

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title>
</head>
<script src="../vue.js"></script>
<style>.box {/* width: 1200px; */height: 500px;display: flex;flex-direction: column;border: rgb(235, 137, 137) solid 3px;border-radius: 33px;}h1,.title {text-align: center;background: linear-gradient(to right, red, rgb(183, 0, 255), blue);-webkit-background-clip: text;-webkit-text-fill-color: transparent;}.body {display: flex;justify-content: space-around;/* background-color: aqua; */}img {width: 200px;height: 300px;}.row {width: 210px;padding-right: 1%;border-right: 1px blueviolet dashed;}.row:last-child {padding-right: 20px;border-right: none;}h3 {text-align: center;}
</style><body><div id="app"><div class="box"><h1 class="title">长相思追剧小游戏</h1><div class="body"><div class="row1 row"><img src="./img/张晚意.jpg" alt=""><h3>苍玄 </h3><button @click="fn(1,0)">罚站+1</button><span>{{result}}:{{result_time}}min </span><button @click="fn(0,1)">坐下+1</button></div><div class="row2 row"><img src="./img/相柳.jpg" alt=""><h3> 相柳 </h3><button @click="fn(1,0)">罚站+1</button><span>{{result}}:{{result_time}}min </span><button @click="fn(0,1)">坐下+1</button></div><div class="row3 row"><img src="./img/涂山璟.jpg" alt=""><h3>涂山璟</h3><button @click="fn(1,0)">罚站+1</button><span>{{result}}:{{result_time}}min </span><button @click="fn(0,1)">坐下+1</button></div><div class="row4 row"><img src="./img/赤水丰隆.jpg" alt=""><h3>赤水丰隆</h3><button @click="fn(1,0)">罚站+1</button><span>{{result}}:{{result_time}}min </span><button @click="fn(0,1)">坐下+1</button></div></div></div><p style="margin-top:100px ;">罚站和坐下 可以变颜色</p></div>
</body><script>const app = new Vue({el: '.row1',data: {result: '咋办',result_time: 0,fail_time: 0,succeed_time: 0,},methods: {fn(ft, st) {this.fail_time += ft;this.succeed_time += stthis.result_time = this.fail_time - this.succeed_timeif (this.result_time > 0) {this.result = '罚站';}else {this.result = "坐下";this.result_time = -this.result_time}console.log(this);}}})const app2 = new Vue({el: '.row2',data: {result: '咋办',result_time: 0,fail_time: 0,succeed_time: 0,},methods: {fn(ft, st) {this.fail_time += ft;this.succeed_time += stthis.result_time = this.fail_time - this.succeed_timeif (this.result_time > 0) {this.result = '罚站';}else {this.result = "坐下";this.result_time = -this.result_time}console.log(this);}}})const app3 = new Vue({el: '.row3',data: {result: '咋办',result_time: 0,fail_time: 0,succeed_time: 0,},methods: {fn(ft, st) {this.fail_time += ft;this.succeed_time += stthis.result_time = this.fail_time - this.succeed_timeif (this.result_time > 0) {this.result = '罚站';}else {this.result = "坐下";this.result_time = -this.result_time}console.log(this);}}})const app4 = new Vue({el: '.row4',data: {result: '咋办',result_time: 0,fail_time: 0,succeed_time: 0,},methods: {fn(ft, st) {this.fail_time += ft;this.succeed_time += stthis.result_time = this.fail_time - this.succeed_timeif (this.result_time > 0) {this.result = '罚站';}else {this.result = "坐下";this.result_time = -this.result_time}console.log(this);}}})</script></html>



优化方向

1.“罚站”和“坐下”的颜色可以改变
2.块结构不对吧,row应该用li
3.笨笨地定义了4个对象,不然,点击人物按钮,其他任务的时长也会变;但肯定有优化的办法,就emmm,类似this.result++ 但是具体的还不会哎
4.每次刷新网页,之前的记录会保留下来,好像是设置DOM啥的,回头在复习一下,都忘记了

http://www.sczhlp.com/news/117936/

相关文章:

  • 临沂网站制作营销网站开发找哪家
  • 济南有做五合一网站公司企业安全文化建设
  • 西安网站开发的空间网络营销方式有几种
  • vs网站开发源码浙江专业网页设计免费建站
  • 甘肃新站优化商标设计网免费
  • 可以做语文阅读题的网站装饰公司营销型网站
  • 推广 广州网站建设公司东莞推广外包
  • 怎么用wordpress打开网站wordpress软件下载站
  • 网站seo优化推广怎么做wordpress和discuz结合
  • 黄石网站开发天津建设招标网站
  • 网站欣赏企业网站搜索引擎拓客
  • ftp怎么做网站的备份做贸易的网站
  • wordpress地址站点地址湖北智能网站建设找哪家
  • 建设网站的公司兴田德润可以吗最好的网站建设组织
  • 专业提供网站制作高密做网站哪家强代理
  • 网站建设办公软件销售技巧一级做爰A视频免费网站
  • 电商网站优化方案WordPress 文章最多字
  • 港口建设申报网站阅读的网站建设需要多少钱
  • 企业门户网站有哪些国外图床 wordpress
  • 彩票网站开发制作h5像优酷平台网站是怎么做的
  • wordpress 架站规划电子商务网站
  • 优购物官方网站直播网站分为四个步骤开发建设
  • 新网站怎么做网络推广表格制作教程 步骤
  • 网站建设进展情况汇报展厅展览
  • 淘宝优惠券返利网站怎么做个人小型网站建设
  • 威海做网站whhl福田公司门口
  • 梅州市做试块网站装修网站设计案例
  • 在线手机动画网站模板下载安装上海建设工程学校网站
  • 网站设计色彩搭配就业服务网站建设方案
  • 泉州seo网站关键词优一键优化什么意思