zoukankan      html  css  js  c++  java
  • [Vue] Import component into page

    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>
  • 相关阅读:
    LibreOJ2095
    Codeforces
    LibreOJ2241
    LibreOJ2044
    LibreOJ2043
    LibreOJ2045
    LibreOJ2042
    LibreOJ2097
    洛谷P4175
    POJ2888
  • 原文地址:https://www.cnblogs.com/Answer1215/p/6323670.html
Copyright © 2011-2022 走看看