VUE框架 组件流程

 

 

 

<template>
<nav>
<h1>welcome to VUE</h1>
<HomeView></HomeView>

</nav>
</template>

<script>
// @ is an alias to /src
import HomeView from '@/views/HomeView.vue'

export default {
name: 'nav',
components: {
HomeView,
}
}
</script>

<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}

nav {
padding: 30px;
}

nav a {
font-weight: bold;
color: #2c3e50;
}

nav a.router-link-exact-active {
color: #42b983;
}
</style>

 

<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld/>
</div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'

export default {
name: 'HomeView',
components: {
HelloWorld
}
}
</script>

 

 

<template>
<div class="hello">
<h2>hello word</h2>


</div>
</template>
<style>
cloor: red;

</style>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h2{
color :red;
}


</style>

 

posted @ 2022-06-18 17:31  呼长喜  阅读(149)  评论(0编辑  收藏  举报