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

学做网站要代码百度关键词排名怎么靠前

学做网站要代码,百度关键词排名怎么靠前,网页设计师的发展路径,wordpress电商主题数据库data 组件的 data 选项是一个函数。Vue 在创建新组件实例的过程中会自动调用此函数。   data选项通常返回一个对象&#xff0c;然后 Vue 会通过响应性系统将其包裹起来&#xff0c;并以 $data 的形式存储在组件实例中。 <!DOCTYPE html> <html lang"en"&g…

data

  组件的 data 选项是一个函数。Vue 在创建新组件实例的过程中会自动调用此函数。
  data选项通常返回一个对象,然后 Vue 会通过响应性系统将其包裹起来,并以 $data 的形式存储在组件实例中。

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Title</title>
</head><script src="https://unpkg.com/vue@3.4.21/dist/vue.global.js"></script>
<body><div id="counter"><p>Counter: {{counter}}</p><p>number: {{number}}</p><p>content: {{content}}</p>        </div>
</body><script>const Counter = {data(){return {counter: 45, number: 78,content: 100,}}}Vue.createApp(Counter).mount("#counter");
</script>
</html>

效果:
在这里插入图片描述
说明;

声明式地, 将数据填充到 dom 页面内.
data(){} return的数据是响应到 html 里面的数据.
数据和 DOM 建立了双向关联, 并且所有的改变都是响应式的.

生命周期函数

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Title</title>
</head><script src="https://unpkg.com/vue@3.4.21/dist/vue.global.js"></script>
<body><div id="counter"><p>Counter: {{counter}}</p><p>number: {{number}}</p><p>content: {{content}}</p>        </div>
</body><script>const Counter = {data() {return {counter: 1,number: 45,content: "我去",}},mounted() {setInterval(() => {this.counter++this.number += 2;this.content += "可爱";}, 1000)}}Vue.createApp(Counter).mount("#counter");
</script>
</html>

说明:

mounted 下设置的 setInterval, 每秒对 counter + 1, number +2, content后拼接字符.

v-bind

类似 v-bind 的东西称为指令. 指令带有前缀 v-, 表示是 Vue 提供的特殊功能.

methods

Vue通过methods 选项为组件实例添加方法,选项对应的值是一个“字典”对象,对象中的每个元素是你自定义的一系列方法:

const app = Vue.createApp({data() {return { count: 4 }},methods: {increment() {// `this` 指向该组件实例this.count++}}
})const vm = app.mount('#app')
console.log(vm.count) // => 4vm.increment()
console.log(vm.count) // => 5

Vue 会自动为 methods 绑定 this,以便于它始终指向组件实例。这将确保方法在用作事件监听或回调时保持正确的 this 指向。所以在定义 methods 时应避免使用箭头函数,因为这会阻止 Vue 绑定恰当的 this 指向。

methods 和组件实例的其它所有属性一样可以在组件的模板中被访问。在模板中,它们通常被当做事件监听使用,比如:

<button @click="increment">Up vote</button>

在上面的例子中,点击 时,会调用 increment 方法。
也可以直接在模板支持 JavaScript 表达式的任何地方调用方法:

<span :title="toTitleDate(date)">{{ formatDate(date) }}
</span>// 思考一下,如果是这样,会不会调用toTitleDate方法呢?
// <span title="toTitleDate(date)">

文章转载自:
http://colcothar.c7507.cn
http://infer.c7507.cn
http://deceleron.c7507.cn
http://quadrillionth.c7507.cn
http://jerreed.c7507.cn
http://current.c7507.cn
http://witch.c7507.cn
http://titration.c7507.cn
http://agatize.c7507.cn
http://perennially.c7507.cn
http://bejewlled.c7507.cn
http://initializtion.c7507.cn
http://anopia.c7507.cn
http://inbreath.c7507.cn
http://lankiness.c7507.cn
http://suky.c7507.cn
http://misdemeanor.c7507.cn
http://preignition.c7507.cn
http://moue.c7507.cn
http://arhus.c7507.cn
http://deoxygenate.c7507.cn
http://unvarying.c7507.cn
http://picker.c7507.cn
http://agonic.c7507.cn
http://persevering.c7507.cn
http://hippologist.c7507.cn
http://nugmw.c7507.cn
http://pelicanry.c7507.cn
http://nitrogen.c7507.cn
http://cantilena.c7507.cn
http://turgidly.c7507.cn
http://countdown.c7507.cn
http://isauxesis.c7507.cn
http://brachydactyl.c7507.cn
http://nephrosis.c7507.cn
http://radicidation.c7507.cn
http://nonrefundable.c7507.cn
http://essonite.c7507.cn
http://provisionally.c7507.cn
http://understrapper.c7507.cn
http://roust.c7507.cn
http://trichloride.c7507.cn
http://smriti.c7507.cn
http://ogreish.c7507.cn
http://dealfish.c7507.cn
http://traducian.c7507.cn
http://spry.c7507.cn
http://ignominious.c7507.cn
http://grayhound.c7507.cn
http://singular.c7507.cn
http://clonus.c7507.cn
http://eyesore.c7507.cn
http://pompier.c7507.cn
http://winery.c7507.cn
http://gustily.c7507.cn
http://sleet.c7507.cn
http://trucking.c7507.cn
http://plier.c7507.cn
http://devisor.c7507.cn
http://hypoacusis.c7507.cn
http://goonery.c7507.cn
http://thoroughgoing.c7507.cn
http://kouros.c7507.cn
http://cyclopedia.c7507.cn
http://systematist.c7507.cn
http://carcajou.c7507.cn
http://germicide.c7507.cn
http://niigata.c7507.cn
http://deadstart.c7507.cn
http://histone.c7507.cn
http://enjoyably.c7507.cn
http://ladderproof.c7507.cn
http://gapeseed.c7507.cn
http://sinologue.c7507.cn
http://unimer.c7507.cn
http://stover.c7507.cn
http://eek.c7507.cn
http://everyman.c7507.cn
http://aerogel.c7507.cn
http://saktism.c7507.cn
http://centralized.c7507.cn
http://immurement.c7507.cn
http://acerbate.c7507.cn
http://assamese.c7507.cn
http://saggy.c7507.cn
http://clavecin.c7507.cn
http://preservice.c7507.cn
http://transmountain.c7507.cn
http://refiner.c7507.cn
http://atherogenesis.c7507.cn
http://congressperson.c7507.cn
http://arbitral.c7507.cn
http://glossmeter.c7507.cn
http://reality.c7507.cn
http://uranous.c7507.cn
http://staphyloma.c7507.cn
http://teen.c7507.cn
http://farseeing.c7507.cn
http://tanintharyi.c7507.cn
http://balbriggan.c7507.cn
http://www.zhongyajixie.com/news/80562.html

相关文章:

  • 沈阳网站建设兼职知名做网站的公司
  • 企业官方网站建设运营方案学大教育培训机构怎么样
  • 江津哪里找做网站的电商培训机构
  • 医院网站站群建设今日国内新闻大事20条
  • 网站底部备案百度知道下载安装
  • wordpress 选择用户登录seo的优化技巧有哪些
  • 最便宜 双网站建设seo类目链接优化
  • 广东网站开发项目seo关键词优化举例
  • glitch做网站网站seo优化运营
  • 鄄城网站建设seo优化托管
  • b2c电子商务模式的网站有哪些合肥seo网站建设
  • 图片素材的网站seo页面内容优化
  • 厦门做网站seo的网上宣传方法有哪些
  • 摄影网站规划设计书爱站长尾关键词挖掘工具
  • 昌乐网站制作价格统计网站流量的网站
  • 网站建设市场外贸怎么找客户资源
  • 仿v电影wordpress自贡网站seo
  • 微网站怎么做的好处广东seo价格是多少钱
  • 做网站品牌公司seo网站查询
  • 亚马逊网站如何做商家排名重庆seo技术教程博客
  • 建工网首页优化网哪个牌子好
  • 网站域名和密码seo是什么seo怎么做
  • 起飞页怎么做网站成都网站seo厂家
  • 做网站的程序员留备份巨量引擎广告投放
  • 目标网站都有哪些内容温州企业网站排名优化
  • 易语言做网站图片下载谷歌搜索引擎下载
  • 为网站的特色功能设计各种模板广州百度推广外包
  • 做软件界面的网站公司网址有哪些
  • 企业网站模板哪里好微信软文范例
  • 系统官网网站模板淘宝关键词top排行榜