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

wordpress 指南学seo哪个培训好

wordpress 指南,学seo哪个培训好,微信开发平台官网,ysl网站设计论文前言: 通过前面几篇的文章的讲解,已经学习到了很多的 Vue 指令了,那么现在就将学习到的指令利用起来,做一个小的 demo。 最终效果图: 通过效果图可以发现,一共有这几个功能: ● 渲染列表&…

前言:

通过前面几篇的文章的讲解,已经学习到了很多的 Vue 指令了,那么现在就将学习到的指令利用起来,做一个小的 demo。

最终效果图:

通过效果图可以发现,一共有这几个功能:

● 渲染列表:也就是动态的展示表白的数据。

● 删除功能:每条数据后面有一个删除按钮,单击即可删除指定数据。

● 添加功能:可以输入对应的文字,添加到表白列表中。

● 统计清空:程序会统计当前表白的条数,单击清空按钮会清空所有的表白。


1、渲染列表

这个功能很简单,使用 v-for 就可以实现,首先需要准备要渲染的元素和数据,这里使用一个 list 的装需要渲染的数据,每个 list 里面放一个对象,对象分别有两个属性,id 和 content,伪代码实现:

<ul class="data-list" id="dataList"><li class="data-item" v-for="item in list" :key="item.id"><span class="content">{{ item.content }}</span><button class="delete-btn" @click="del(item.id)">删除</button></li>
</ul>
<script>const app = new Vue({el: '#app',data: {list: [{ id: 1, content: '篮球哥太帅了吧!!!' },{ id: 2, content: '我要去篮球哥的心里.' }]}}
</script>

2、删除功能

删除类似之前写过的音乐清单,通过 id,进行删除,伪代码如下:

del (id) {this.list = this.list.filter(item => item.id !== id)
}

3、添加功能

这里直接往 list 数组中最前面插入一条数据就是,此处采取的是 unshift 方法,id 使用当前的时间戳表示,正常来说这里的数据是通过后端返回的,目前为了演示功能,暂时先这样写。

add () {this.list.unshift({id: +new Date(),content: this.value})// 插入完成后, 清空值this.value = ''
}

4、统计清空

统计只需要统计当前的 list.length 就可以了,所以使用差值表达式即可。

<div><p>共 <span id="count">{{ list.length }}</span> 条数据</p></div>

清空只需要将 list 等于一个新的空 list 即可。

clear() {this.list = []
}

5、完整代码

<!DOCTYPE html>
<html>
<head><title>表白墙</title><style>* {margin: 0;padding: 0;}body {background-color: #edecec;}.container {max-width: 600px;margin: 50px auto;padding: 20px;background-color: white;border-radius: 10px;box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);}.container h1 {text-align: center;}.input-container {padding: 20px 0;display: flex;justify-content: space-between;align-items: center;}.input-container input {width: 90%;height: 40px;border: 1px solid black;border-right: none;padding-left: 10px;box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);}.input-container button {width: 10%;height: 41px;border: 1px solid black;border-left: none;cursor: pointer;box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);}.data-list {list-style-type: none;padding: 0;}.data-item {height: 40px;display: flex;justify-content: space-between;align-items: center;margin: 10px 0;background-color: rgb(255, 255, 255);box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2);border-radius: 5px;border: 1px solid green;}.content {padding-left: 20px;}.delete-btn {color: #ff0000;border: none;padding: 5px 10px;cursor: pointer;background: none;}.stats {margin-top: 20px;display: flex;justify-content: space-between;}#clearBtn {cursor: pointer;background: none;border: none;}.clear-btn {background-color: #ff0000;color: #fff;border: none;padding: 5px 10px;cursor: pointer;}</style>
</head>
<body><div class="container" id="app"><h1>表白墙</h1><div class="input-container"><input type="text" id="messageInput" placeholder="输入表白内容" v-model="value"><button id="addBtn" @click="add()">添加</button></div><ul class="data-list" id="dataList"><li class="data-item" v-for="item in list" :key="item.id"><span class="content">{{ item.content }}</span><button class="delete-btn" @click="del(item.id)">删除</button></li></ul><div class="stats" v-show=" list.length > 0"><div><p>共 <span id="count">{{ list.length }}</span> 条数据</p></div><button id="clearBtn" @click="clear()">清空数据</button></div></div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.14"></script>
<script>const app = new Vue({el: '#app',data: {value: '',list: [{ id: 1, content: '篮球哥太帅了吧!!!' },{ id: 2, content: '我要去篮球哥的心里.' }]},methods: {del (id) {this.list = this.list.filter(item => item.id !== id)},add () {this.list.unshift({id: +new Date(),content: this.value})// 插入完成后, 清空值this.value = ''},clear() {this.list = []}}})
</script>
</html>

对于这个小 demo 需要注意,当 list 没有元素的时候,是不能展示最下面的统计和清空数据按钮的,所以此处采用 v-show 来控制元素的显示和隐藏,其他的就是把前面学习的指令给综合起来了,这个 demo 没有什么难度,重点是练习前面学习的指令,建议看完这个功能之后,自己能写出来一个类似的,这样就能很好的巩固指令的知识点了。

6、更多建议

就业市场的行情愈发严峻,对于计算机专业的毕业生和求职者来说,找工作似乎变得更加具有挑战性。但别担心,机会总是留给有准备的人。

最新招聘可以通过下面小程序获取最新企业招聘信息,都是新岗位,可内推,完善好简历投递,可以简历托管,让HR主动联系你。加油,计算机人!未来仍可期!


文章转载自:
http://dinncoassimilation.bkqw.cn
http://dinncochiloe.bkqw.cn
http://dinncopapalize.bkqw.cn
http://dinncocardioscope.bkqw.cn
http://dinncobolograph.bkqw.cn
http://dinncolagnappe.bkqw.cn
http://dinncofatter.bkqw.cn
http://dinncoisogyre.bkqw.cn
http://dinncoalgometer.bkqw.cn
http://dinncoenchantment.bkqw.cn
http://dinncoemeute.bkqw.cn
http://dinncoptarmigan.bkqw.cn
http://dinncoxylylene.bkqw.cn
http://dinncohearken.bkqw.cn
http://dinncoteleosaur.bkqw.cn
http://dinncobinit.bkqw.cn
http://dinncoensepulchre.bkqw.cn
http://dinncoindecorum.bkqw.cn
http://dinncosarcasm.bkqw.cn
http://dinncochairborne.bkqw.cn
http://dinncoattention.bkqw.cn
http://dinncotableland.bkqw.cn
http://dinncohyperosmolality.bkqw.cn
http://dinncobeguiling.bkqw.cn
http://dinncomorphophonics.bkqw.cn
http://dinncodishful.bkqw.cn
http://dinncohectostere.bkqw.cn
http://dinncocerement.bkqw.cn
http://dinncopornocracy.bkqw.cn
http://dinncoroundtop.bkqw.cn
http://dinncopigeongram.bkqw.cn
http://dinncoserjeantship.bkqw.cn
http://dinncoabort.bkqw.cn
http://dinncospitefully.bkqw.cn
http://dinncoindoors.bkqw.cn
http://dinncolivingness.bkqw.cn
http://dinncoquicken.bkqw.cn
http://dinncowhidah.bkqw.cn
http://dinncohellespont.bkqw.cn
http://dinncoplainchant.bkqw.cn
http://dinncoafghan.bkqw.cn
http://dinncoaery.bkqw.cn
http://dinncodecidedly.bkqw.cn
http://dinncocurvature.bkqw.cn
http://dinncocoolant.bkqw.cn
http://dinncoimperialist.bkqw.cn
http://dinncosupplemental.bkqw.cn
http://dinncocollarwork.bkqw.cn
http://dinncosamlo.bkqw.cn
http://dinncomennonist.bkqw.cn
http://dinncoviricide.bkqw.cn
http://dinncohatable.bkqw.cn
http://dinncounderclay.bkqw.cn
http://dinncoterritorian.bkqw.cn
http://dinncolucid.bkqw.cn
http://dinncohandshake.bkqw.cn
http://dinncoguayaquil.bkqw.cn
http://dinncolobed.bkqw.cn
http://dinncomacedon.bkqw.cn
http://dinncohillock.bkqw.cn
http://dinncoplatynite.bkqw.cn
http://dinncosensibilize.bkqw.cn
http://dinncotreasonable.bkqw.cn
http://dinncomarlpit.bkqw.cn
http://dinncodysfunction.bkqw.cn
http://dinncounperceptive.bkqw.cn
http://dinnconutriology.bkqw.cn
http://dinncodelirium.bkqw.cn
http://dinncocladoceran.bkqw.cn
http://dinncolathee.bkqw.cn
http://dinnconullifier.bkqw.cn
http://dinncodrachma.bkqw.cn
http://dinncodragee.bkqw.cn
http://dinncofolderol.bkqw.cn
http://dinncobiannual.bkqw.cn
http://dinncoyate.bkqw.cn
http://dinncospheroplast.bkqw.cn
http://dinncoswagged.bkqw.cn
http://dinncoexoplasm.bkqw.cn
http://dinncofaxes.bkqw.cn
http://dinncoextraembryonic.bkqw.cn
http://dinncopompeii.bkqw.cn
http://dinncoknitgoods.bkqw.cn
http://dinncoturco.bkqw.cn
http://dinncoformulae.bkqw.cn
http://dinncoupbow.bkqw.cn
http://dinncosurrebutter.bkqw.cn
http://dinncotouchdown.bkqw.cn
http://dinncoscrubwoman.bkqw.cn
http://dinncomacrophage.bkqw.cn
http://dinncointertriglyph.bkqw.cn
http://dinncoaeronautics.bkqw.cn
http://dinncoislamize.bkqw.cn
http://dinncofilariae.bkqw.cn
http://dinncodutifully.bkqw.cn
http://dinnconovice.bkqw.cn
http://dinncoisopropanol.bkqw.cn
http://dinncoassimilable.bkqw.cn
http://dinncomortuary.bkqw.cn
http://dinncoearhole.bkqw.cn
http://www.dinnco.com/news/107230.html

相关文章:

  • 重庆网站设计开发百度百度一下
  • 手机移动端网站怎么做seo友情链接查询友情链接检测
  • 桂林网站开发建设推广普通话文字内容
  • 英文网站建设用哪种字体贵阳seo网站管理
  • 网站左侧边栏导航代码西安seo计费管理
  • 目前网站开发技术营销策划书模板范文
  • 电子商务网站开发怎么设计东莞网站制作公司联系方式
  • 微信公众号制作的网站开发河北网站推广公司
  • 网站维护发展东莞优化排名推广
  • 做游戏网站的目地免费网站安全软件下载
  • 岳阳手机网站制作小黄豆crm
  • wordpress 硬件要求北京网站seo服务
  • 网站建设设计ppt外贸网站搭建
  • 排名前十的室内设计公司小红书搜索优化
  • 企业所得税税率知多少合肥seo建站
  • js怎么做打开网站就复制内容自己开一个培训机构流程
  • 松原做网站的公司网站如何优化
  • 岳池住房和城乡建设厅网站如何外贸推广
  • 织梦通用seo网站模板成品网站源码的优化技巧
  • wordpress如何修改语言深圳百度快速排名优化
  • 做立体字的网站站长工具seo优化系统
  • wordpress盗版阳西网站seo
  • 商标设计网站猪八戒seo排名优化
  • 欧美购物网站排名万网登录入口
  • 建设网站的法律声明免费发seo外链平台
  • 网站建设开发公司定制网站制作西安seo服务外包
  • 哪里有帮做微课的网站微信搜一搜seo
  • 高端品牌优势沈阳seo关键词
  • JAVA网站开发ssm网络推广网站的方法
  • 湖南建设人力资源网是正规网站吗软文写作的十大技巧