问题描述:
最近做广告展示,希望广告显示样式内容 是通过服务端返回响应的标签代码,然后通过vue 动态渲染出来。但是经测试发现,uview 标签无法正常渲染,望得到社区帮助
但是能渲染原生标签和 el组件标签(el 饿了么系)  
 
插件代码如下:
<template>  
  <div>  
    <view>这是一个组件文本</view>  
    <ad-plugin :html="adInfo.jsCode" v-if="visible" ref="adShow"></ad-plugin>  
  </div>  
</template>  
<script>  
import Vue from 'vue/dist/vue.esm.js';  
export default {  
  name:'smAdShowPlugin',  
  props:['page-code','location-code','app-platform'],  
  data() {  
    return {  
      visible:false,  
      adInfo:{  
        jsCode:'<u-image src="https://cdn.uviewui.com/uview/swiper/2.jpg"></u-image>',  
      },  
      src: 'https://cdn.uviewui.com/uview/swiper/2.jpg'  
    };  
  },  
  components: {  
   adPlugin: {  
     props: {  
       html: String  
     },  
     render(h) {  
       const tagStr = Vue.extend({  
         template: this.html  
       })  
       return h(tagStr, {})  
     }  
   }  
  },  
  mounted() {  
    this.visible = true  
  },  
  onShow() {  
     this.visible = true  
  },  
  onReachBottom() {},  
  methods: {  
  }  
};  
</script> 
             
             
             
			 
                                        
                                    



 
                                                                    