zoukankan      html  css  js  c++  java
  • vue父组件向子组件传递数据

    父组件
    <template>
      <div id="app">
        <v-header :childseller="fatherseller"></v-header>
      </div>
    
    </template>
    
    <script type="text/ecmascript-6">
      import header from 'components/header/header.vue';
    
      export default{
            props: {},
            data()
            {
                return {
                  fatherseller:{
                      'name':'mull',
                      'phpne':'18844413684'
                  }
                }
            },
            created() {
    
            },
            methods: {},
            components: {
                'v-header':header,
    
            },
            computed: {}
        }
    </script>
    
    <!-- Add "scoped" attribute to limit CSS to this component only -->
    <style scoped lang="stylus" rel="stylesheet/stylus">
    
    </style>
    子组件
    <template>
        <div id="header">
          {{childseller.name}}
        </div>
    </template>
    
    <script type="text/ecmascript-6">
        export default{
            props: {
              childseller:Object
            },
            data()
            {
                return {}
            },
            created() {
    
            },
            methods: {},
            components: {},
            computed: {}
        }
    </script>
    
    <!-- Add "scoped" attribute to limit CSS to this component only -->
    <style scoped lang="stylus" rel="stylesheet/stylus">
    
    </style>
  • 相关阅读:
    Spring 注解详解01
    java 排序算法
    Java 文件拼接器
    oracle join
    Oracle 去重
    Java 笔试面试
    Oracle 笔试题02
    jvm性能查看常用命令
    关于对JMM(java内存模型)的个人理解
    RSA前端加密后端解密避免出现明文密码
  • 原文地址:https://www.cnblogs.com/norm/p/7349567.html
Copyright © 2011-2022 走看看