Coggle requires JavaScript to display documents.
<template> // Phần code cho UI của bạn </template> <script> import SomeThing from 'some-where'; export default { // Phần code script của bạn } </script> <style> // Phần code style cho giao diện của bạn </style>
<template> <div class="app"> <p>Hour: {{ hour }}</p> </div> </template> <script> export default { data() { return { hour: new Date().getHours() } } } </script>
<template> <div class="app"> <p>The second dog is {{ dogs[1] }}</p> <p>All the dogs are {{ dogs }}</p> </div> </template> <script> export default { data() { return { dogs: ['Rex', 'Rover', 'Henrietta', 'Alan'] } } } </script>
<template v-for="list of student"> <li class="border"></li> <li>{{ list }}</li> </template>
<template v-if="ok"> <h1>Hello Tú</h1> <p>Welcome back!</p> </template>
<div id="example-1"> <button v-on:click="counter += 1">Đếm cừu</button> <p>{{ counter }} con cừu.</p> </div> var example1 = new Vue({ el: '#example-1', data: { counter: 0 } })
<button v-on:click="numberPlus">Click</button> --script data: {counter: 0} methods: { numberPlus: function () { this.counter += 1; } }
<button v-on:click="say('hello')">Hello</button>
<a v-on:click.stop="doThis"></a>
<a v-on:click.stop.prevent="doThat"></a>
@click.prevent.self sẽ ngăn **toàn bộ click** còn @click.self.prevent
components: { 'tdc-component':{ template : '<h5>Chào mừng bạn đến với website Hoc.tv</h5>' } }