「Javascript/nuxtjs/helloworld」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「pages/index.vue <pre> <template> <div id="app"> <h1>{{ this.msg }}</h1> </div> </template> <script> export default { name: 'app', data () { return {...」) |
|||
| (同じ利用者による、間の8版が非表示) | |||
| 行1: | 行1: | ||
| + | |||
pages/index.vue | pages/index.vue | ||
<pre> | <pre> | ||
<template> | <template> | ||
<div id="app"> | <div id="app"> | ||
| − | <h1>{{ | + | <h1>{{ msg }}</h1> |
</div> | </div> | ||
</template> | </template> | ||
| 行9: | 行10: | ||
export default { | export default { | ||
name: 'app', | name: 'app', | ||
| − | data () { | + | data() { |
return { | return { | ||
| − | msg: 'Welcome to | + | msg: 'Welcome to App' |
} | } | ||
}, | }, | ||
| 行40: | 行41: | ||
} | } | ||
</pre> | </pre> | ||
| + | |||
| + | ==実行== | ||
| + | $ yarn dev | ||
| + | |||
| + | ==参考== | ||
| + | [[Javascript/vue/node/helloworld]] [ショートカット] | ||
2021年6月9日 (水) 18:16時点における最新版
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;
}
実行
$ yarn dev
参考
Javascript/vue/node/helloworld [ショートカット]
