acdr-ui/dist/build/mp-weixin/sheep/components/s-richtext-block/s-richtext-block.js

2 lines
893 B
JavaScript

"use strict";const t=require("../../../common/vendor.js"),e=require("../../api/promotion/article.js");if(!Array){t.resolveComponent("mp-html")()}Math;const n={__name:"s-richtext-block",props:{data:{type:Object,default:{}},styles:{type:Object,default(){}}},setup(n){const r=n,o=t.reactive({content:""});return t.onMounted((()=>{return t=this,n=null,a=function*(){const{data:t}=yield e.ArticleApi.getArticle(r.data.id);o.content=t.content},new Promise(((e,r)=>{var o=t=>{try{s(a.next(t))}catch(e){r(e)}},i=t=>{try{s(a.throw(t))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(o,i);s((a=a.apply(t,n)).next())}));var t,n,a})),(e,r)=>({a:t.p({content:o.content}),b:t.s({marginLeft:n.styles.marginLeft+"px",marginRight:n.styles.marginRight+"px",marginBottom:n.styles.marginBottom+"px",marginTop:n.styles.marginTop+"px",padding:n.styles.padding+"px"})})}};wx.createComponent(n);