v once
This commit is contained in:
parent
568ce4f953
commit
ffaec02119
4
app.js
4
app.js
|
@ -1,10 +1,12 @@
|
|||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
title: "Hello world."
|
||||
title: "Hello World",
|
||||
link: "https://google.com"
|
||||
},
|
||||
methods: {
|
||||
sayHello(){
|
||||
this.title = 'Hello';
|
||||
return this.title;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
</head>
|
||||
<body>
|
||||
<div id='app'>
|
||||
<p>{{ sayHello() }}</p>
|
||||
<h1 v-once>{{title}}</h1>
|
||||
<p>{{ sayHello() }}</p> - <a v-bind:href="link">Google</a>
|
||||
</div>
|
||||
|
||||
<script src="app.js" charset="utf-8"></script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user