为什么访问http://localhost:8080/
的时候显示不出来这个Test.vue
里面的东西呢?
App.vue
里面的代码
<template>
<div id="app">
<Test></Test>
</div>
</template>
<script>
import Test from '@/components/Test'
export default {
}
</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;
}
</style>
Test.vue
的代码
<template>
<div>
<button class="btn">{{msg}}</button>
</div>
</template>
<script>
export default {
name: 'Test',
data () {
return {
msg: 'test'
}
}
}
</script>
<style scoped>
.btn{background-color:blue;}
</style>
App.vue 中