当前位置:网站首页>4. Data binding
4. Data binding
2022-07-03 19:38:00 【Shura MIUI】
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Data binding </title>
<script type="text/javascript" src="./vue.js"></script>
</head>
<body>
<div id="root">
<h3>{
{
name}}</h3>
</div>
</body>
</html>
<script type="text/javascript">
// Vue and div Analytic process :div->Vue Parse out page ->div
Vue.config.productionTip = false;
const v = new Vue({
// el: '#root',// The first way to write it
data: {
name: 'jack',
}
});
//dom Objects and vue Instance Association , Here is a delay binding data
setTimeout(()=>{
v.$mount('#root');// The second way of writing is more flexible ,mount Mount means
},3000);
new Vue({
el:'#root',
// data The first way to write it
data:{
name:'llx'
}
// data The second way
data:function(){
console.log(this);// Here this when Vue Instance object
return {
name:'llx'
}
}
// The writing above is troublesome , So the following expressions can also be used
data(){
console.log(this);// Here this when Vue Instance object
return {
name:'llx'
}
}
// in addition
data:()=>{
console.log(this);// At this time this Point to window object
return {
name:'llx'
}
}
});
</script>
边栏推荐
- 01. Preparation for automated office (free guidance, only three steps)
- 2022.2.14 Li Kou - daily question - single element in an ordered array
- 10 smart contract developer tools that miss and lose
- Chapter 20: y= sin (x) /x, rambling coordinate system calculation, y= sin (x) /x with profile graphics, Olympic rings, ball rolling and bouncing, water display, rectangular optimization cutting, R que
- 第一章: 舍罕王失算
- Day10 ---- 强制登录, token刷新与jwt禁用
- P1891 crazy LCM (Euler function)
- The necessity of lean production and management in sheet metal industry
- 第一章:递归求n的阶乘n!
- Sentinel source code analysis part II - sentinel dashboard console startup and configuration
猜你喜欢
第一章:求所有阶乘和数,大奖赛现场统分程序设计,三位阶乘和数,图形点扫描,递归求n的阶乘n!,求n的阶乘n!,舍罕王失算
[proteus simulation] a simple encrypted electronic password lock designed with 24C04 and 1602LCD
Use of aggregate functions
Thesis study - 7 Very Deep Convolutional Networks for Large-Scale Image Recognition (3/3)
[free sharing] kotalog diary2022 plan electronic manual ledger
Part 28 supplement (XXVIII) busyindicator (waiting for elements)
Chapter 1: drinking soft drinks, step tariff calculation, step tariff calculation function, personal income tax, solving square root inequality, simplifying solving square root inequality, solving dem
Chapter 1: King Shehan miscalculated
03 -- QT OpenGL EBO draw triangle
[wallpaper] (commercially available) 70 wallpaper HD free
随机推荐
PR 2021 quick start tutorial, how to create a new sequence and set parameters?
Valentine's Day - make an exclusive digital collection for your lover
Floating source code comment (38) parallel job processor
2022-06-25 advanced network engineering (XI) IS-IS synchronization process of three tables (neighbor table, routing table, link state database table), LSP, cSNP, psnp, LSP
Difference between surface go1 and surface GO2 (non professional comparison)
UE source code analysis: uccharactermovementcomponent - rootmotion
PR FAQ: how to set PR vertical screen sequence?
How does if ($variable) work? [repeat] - how exactly does if ($variable) work? [duplicate]
Chapter 1: seek common? Decimal and S (D, n)
Recommend a GIF processing artifact less than 300K - gifsicle (free download)
Ego planner code parsing Bspline_ Optimizer section (2)
Pecan - route
Next spread
Zhang Fei hardware 90 day learning notes - personal record of day 3, please see my personal profile / homepage for the complete
Chapter 1: simplify the same code decimal sum s (D, n)
The space of C disk is insufficient, and the computer becomes stuck. Quickly expand the capacity of C disk to make the system more smooth
Unittest framework is basically used
5- (4-nitrophenyl) - 10,15,20-triphenylporphyrin ntpph2/ntppzn/ntppmn/ntppfe/ntppni/ntppcu/ntppcd/ntppco and other metal complexes
第一章:求所有阶乘和数,大奖赛现场统分程序设计,三位阶乘和数,图形点扫描,递归求n的阶乘n!,求n的阶乘n!,舍罕王失算
Read the paper glodyne global topology preserving dynamic network embedding