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

[Vue] Import component into page

时间:2017-01-20 20:31:55      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:item   style   component   and   cti   rom   blog   contain   logs   

Components are one of the most powerful features of Vue. Let‘s take a look at how to write our first components and make use of them in a parent component.

 

Create a component: 

// item-description.vue

<template>
    <h1>
        This is item description
    </h1>
</template>

<script>
export default {
name: ‘item-description‘
}
</script>

 

Page:

<template>

    <section class="container">
        <item-description></item-description>
    </section>
</template>

<script> import ItemDescription from ../components/item-description; export default { components: { ItemDescription } } </script>

 

[Vue] Import component into page

标签:item   style   component   and   cti   rom   blog   contain   logs   

原文地址:http://www.cnblogs.com/Answer1215/p/6323670.html

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