父传子要想传递路径必须要使用require函数,比如我在写淘宝放大镜组件时,需要传入大小两张图片 1.在模板中将数据和要传入的数据绑定 <my-magnify :data="data.i"></my-magnify> data() { return { data: