惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
C
Cybersecurity and Infrastructure Security Agency CISA
T
Troy Hunt's Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
AI
AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 热门话题
W
WeLiveSecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Cisco Blogs
S
Security Affairs
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
Security Latest
Security Latest
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google DeepMind News
Google DeepMind News
博客园_首页
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
T
The Blog of Author Tim Ferriss
Recent Commits to openclaw:main
Recent Commits to openclaw:main
阮一峰的网络日志
阮一峰的网络日志
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Threat Research - Cisco Blogs
P
Privacy International News Feed
I
Intezer
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
K
Kaspersky official blog
S
Schneier on Security
云风的 BLOG
云风的 BLOG
有赞技术团队
有赞技术团队
爱范儿
爱范儿
博客园 - 叶小钗
博客园 - Franky
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Cloudbric
Cloudbric
V
V2EX
大猫的无限游戏
大猫的无限游戏
Scott Helme
Scott Helme
H
Hacker News: Front Page
SecWiki News
SecWiki News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】

博客园 - IT-caijw

claude + trae Redis 介绍与 Node.js 使用教程 技术人日常避坑手册:高效工作,少踩坑 AI应用开发-本地大模型部署与API调用实战:LM Studio完整教程 Cursor AI 实用指南:10个具体示例 AI 是搭子不是替代者:我用大模型工具(cursor,trae)编程的一年经验总结 uniapp 闪屏页被拉伸解决方案 9图制作 X-ECharts:Vue项目中数据可视化的终极利器 jsWebControl解决海康视频插件窗口遮挡层级问题 es6划重点 - IT-caijw - 博客园 Promise原理讲解 async+await应用(异步回调解决方案) - IT-caijw - 博客园 echarts 的日常(教学篇) - IT-caijw - 博客园 angularjs 基础 ## HBuilder MUI开发时genymotion模拟器连接Hbuilder vue07-router 路由 vue05-REST 请求 vue06-single-file-component vue04-components vue02-filters-computer
vue03-directives 指令
IT-caijw · 2018-02-22 · via 博客园 - IT-caijw

directives 指令

v-for 循环
v-on:click 点击事件
v-model model绑定

methods 方法
const app = new Vue({
	el : '#app',
	data : {
		friends: [
			{
				first : 'bobby',
				last : 'banne',
				age : 25
			},
			{
				first : 'john',
				last : 'Baby',
				age : 25
			}
		]
		
	},
	//自动计算
	computed : {
		bobbyFullName(){
			return `${this.bobby.first} ${this.bobby.last}`;
		},
		johnFullName(){
			return `${this.john.first} ${this.john.last}`;
		},
		bobbyAge(){
			return this.bobby.age;
		}
	},
	//查找
	filters: {
	    ageInOneYear(age) {
	      return age + 1;
	    },
	    fullName(value) {
	      return `${value.last}, ${value.first}`;
	    }
	},
	methods : {
		incrementAge(friend){
			friend.age =  friend.age + 1;
		},
		decrementAge(friend) {
	      friend.age = friend.age - 1;
	    }
	},
	template : `<div>
		<h2 v-for="friend in friends">
			<h2>age: {{friend.age}}</h2>
			<h2>Name: {{friend | fullName}}</h2>
			<button v-on:click="incrementAge(friend)">+</button>
			<input v-model="friend.first"/>
			<input v-model="friend.last"/>
			<button v-on:click="decrementAge(friend)">-</button>
		</h2>
	</div>`
})