码迷,mamicode.com
首页 > 其他好文 > 详细

vue06-single-file-component

时间:2018-02-25 11:16:03      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:pac   其他   pos   pack   world   scope   cli   nts   vue-cli   

vue-cli下载

npm i -g vue-cli
vue list
vue init webpack

加载其他模块

<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <Module />
    <Module1 />
  </div>
</template>

<script>
import Module from ‘./module‘;
import Module1 from ‘./module1‘;
export default {
  name: ‘HelloWorld‘,
  components: {
    Module,
    Module1
  },
  data () {
    return {
      msg: ‘Welcome to Your Vue.js App‘
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>

module.vue

<template>
    <div>
        <h1>module111</h1>
    </div>
</template>

<script>
    export default {

    }
</script>

<style scoped>
    h1{
        color:red;
    }
</style>

vue06-single-file-component

标签:pac   其他   pos   pack   world   scope   cli   nts   vue-cli   

原文地址:https://www.cnblogs.com/caijw/p/8468668.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!