uniapp父向子组件传参

<template>

<view>

<img-border :mysrc="mysrc1"></img-border>

<img-border :mysrc="mysrc2"></img-border>

</view>

</template>


<script>

/* 

父向子传递 

*/

//引入组件

import imgBorder from "@/components/img-border";

export default {

data(){

return {

mysrc1:"这里放图片地址",

mysrc2:"这里放图片地址"

}

},

//注册组件

components:{

imgBorder

}

}

</script>


<style>

.content{

.sass{

background-color:$uni-color-primary;

}

}


</style>



uniapp父向子组件传参(图1)

您可能还会对下面的文章感兴趣: