๋ฐ์ํ
index.js
Vue.component('todo-item', {
template: '<li>ํ ์ผ ํญ๋ชฉ ํ๋์
๋๋ค.</li>'
})
var app = new Vue({ // ์์ Vue.component๋ ์์๊ฐ ๋ฐ๋๋ฉด ํ๋ฉด์ ์ถ๋ ฅ์ด ์๋๋ค!
el: '#app'
})
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="index.css">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<ol>
<todo-item></todo-item>
<todo-item></todo-item>
</ol>
</div>
<script src="index.js"></script>
</body>
</html>
๋ฐ์ํ
'JavaScript > Vue' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Vue.js] v-on (0) | 2021.12.28 |
---|---|
[Vue.js] v-bind ๋? (0) | 2021.12.28 |
[Vue.js] vue-router๋ฅผ ์ฌ์ฉํ๋ ์ฌ๋ฌ ๊ฐ์ง ๋ฐฉ๋ฒ (0) | 2021.10.25 |
[Vue.js] vue-router ์ด๋? (0) | 2021.10.25 |
@ : ์ ๋ ๊ฒฝ๋ก(root)๋ถํฐ ์์ (0) | 2021.10.22 |
๋๊ธ