引入vue-layer全局注册
npm i vue-layer // layer import layer from 'vue-layer' Vue.prototype.$layer = layer(Vue)
import commTagModal from “引入的组件” this.$layer.iframe({ content: { content: “引入的组件”, parent: this, data: { tips: 0, } }, area: ['90%', '90%'], // 前面设置宽度 后面设置高度 title: `详细信息`, resize: true, maxmin: true, shadeClose: false })
在引入的组件props会自动添加layerid
export default { props: ['layerid'], name: 'name', mounted () { document.getElementById(this.layerid).style.zIndex = 10000 }, data () {} }