index.vue 955 Bytes
Newer Older
fukai committed
1 2 3 4 5 6 7 8 9 10
<template>
    <div>
        <el-form>
        <compa v-bind:model="model.a" />
        <compb v-bind:model="model.b" />
        <compc ref="compc"/>
        </el-form>
        <p>
            {{model.a.val+"||"+model.b.val}}
        </p>
liuxin committed
11
        <c-button @click="getcompc">按钮</c-button>
fukai committed
12 13 14 15 16 17 18 19
    </div>
</template>

<script>
import CompA from './CompA'
import CompB from './CompB'
import CompC from "./CompC"
export default {
潘际乾 committed
20
    name: 'Tstopn',
fukai committed
21 22 23 24
    components:{
        compa:CompA,
        compb:CompB,
        compc:CompC
liuxin committed
25 26 27
    },
    computed: {

28 29 30 31 32
    },
    provide() {
        return {
            root: this
        }
fukai committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
    },
    data(){
        return {
                model:{
                    a:{val:'a'},
                    b:{val:'b'}
                }

            }
    },
    methods:{
        getcompc:function(){
            console.log(JSON.stringify(this.$refs.compc.model))
            console.log(123456);
        }
    }
}
</script>