「Javascript/nuxtjs/helloworld」の版間の差分
提供: 初心者エンジニアの簡易メモ
| 行4: | 行4: | ||
<template> | <template> | ||
<div id="app"> | <div id="app"> | ||
| − | <h1>{{ | + | <h1>{{ msg }}</h1> |
</div> | </div> | ||
</template> | </template> | ||
| 行10: | 行10: | ||
export default { | export default { | ||
name: 'app', | name: 'app', | ||
| − | data () { | + | data() { |
return { | return { | ||
| − | msg: 'Welcome to | + | msg: 'Welcome to App' |
} | } | ||
}, | }, | ||
2021年6月7日 (月) 17:06時点における版
pages/index.vue
<template>
<div id="app">
<h1>{{ msg }}</h1>
</div>
</template>
<script>
export default {
name: 'app',
data() {
return {
msg: 'Welcome to App'
}
},
mounted() {
// インスタンスがマウントされた直後に実行
}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
参考
Javascript/vue/node/helloworld [ショートカット]
