@click
This commit is contained in:
parent
78e0c132e7
commit
1ac671e702
11
app.js
11
app.js
|
@ -1,14 +1,11 @@
|
||||||
var app = new Vue({
|
var app = new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
data: {
|
data: {
|
||||||
title: "Hello World",
|
counter: 0
|
||||||
link: "https://google.com",
|
|
||||||
finishedLink: '<a href="http://google.com/">Google</a>'
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods:{
|
||||||
sayHello(){
|
click(){
|
||||||
this.title = 'Hello';
|
this.counter++;
|
||||||
return this.title;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -7,10 +7,8 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id='app'>
|
<div id='app'>
|
||||||
<h1 v-once>{{title}}</h1>
|
<button @click="click">Click Me</button>
|
||||||
<p>{{ sayHello() }}</p> - <a v-bind:href="link">Google</a>
|
<p>{{ counter }}</p>
|
||||||
|
|
||||||
<p v-html="finishedLink"></p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="app.js" charset="utf-8"></script>
|
<script src="app.js" charset="utf-8"></script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user