vue cli (练习修改文件篇)

根据前篇配置好脚手架修改简单的文件

在div中加入想要的标题

在pycm中点开

输入npm run serve 打开本地连接

 

创建一个vue

<template>
    <a href="http://www.baidu.com">{{name}}一下</a>
</template>
<script>
    export default {
        name: 'bd',
        data: function () {
            return {
                name:'百度'
            }
        }
    }
</script>
<style>
    a{
        color: aqua;
    }
</style>
<style>
</style>

  

在app中修改一下配置

<template>
  <div id="app">
    自己写的标题<br>
    <!--使用组件-->
    <jd></jd><br>
    <bd></bd>
  </div>
</template>

<script>
import bd from './components/bd.vue'
import jd from './components/jd.vue'
export default {
  name: 'app',
  components: { //注册组件
      'jd':jd,
      'bd':bd
  }
}
</script>

  

a标签字体颜色

a{
        color: aqua;
    }

  

 

posted @ 2018-12-13 20:47  浮生若梦不悔  阅读(693)  评论(0编辑  收藏  举报