You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
4.4 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uview-ui/components/u-parse/u-parse"],{393:function(n,e,t){"use strict";t.r(e);var i=t(394),r=t(396);for(var o in r)["default"].indexOf(o)<0&&function(n){t.d(e,n,(function(){return r[n]}))}(o);t(400);var c,s=t(33),u=Object(s["default"])(r["default"],i["render"],i["staticRenderFns"],!1,null,null,null,!1,i["components"],c);u.options.__file="uview-ui/components/u-parse/u-parse.vue",e["default"]=u.exports},394:function(n,e,t){"use strict";t.r(e);var i=t(395);t.d(e,"render",(function(){return i["render"]})),t.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),t.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),t.d(e,"components",(function(){return i["components"]}))},395:function(n,e,t){"use strict";var i;t.r(e),t.d(e,"render",(function(){return r})),t.d(e,"staticRenderFns",(function(){return c})),t.d(e,"recyclableRender",(function(){return o})),t.d(e,"components",(function(){return i}));var r=function(){var n=this,e=n.$createElement;n._self._c},o=!1,c=[];r._withStripped=!0},396:function(n,e,t){"use strict";t.r(e);var i=t(397),r=t.n(i);for(var o in i)["default"].indexOf(o)<0&&function(n){t.d(e,n,(function(){return i[n]}))}(o);e["default"]=r.a},397:function(n,e,t){"use strict";(function(n){var i=t(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(t(398)),o=[],c=t(399),s=function(){t.e("uview-ui/components/u-parse/node/node").then(function(){return resolve(t(489))}.bind(null,t)).catch(t.oe)},u={name:"mp-html",data:function(){return{nodes:[]}},mixins:[r.default],components:{node:s},watch:{content:function(n){this.setContent(n)}},created:function(){this.plugins=[];for(var n=o.length;n--;)this.plugins.push(new o[n](this))},mounted:function(){this.content&&!this.nodes.length&&this.setContent(this.content)},beforeDestroy:function(){this._hook("onDetached"),clearInterval(this._timer)},methods:{in:function(n,e,t){n&&e&&t&&(this._in={page:n,selector:e,scrollTop:t})},navigateTo:function(e,t){var i=this;return new Promise((function(r,o){if(!i.useAnchor)return o("Anchor is disabled");t=t||parseInt(i.useAnchor)||0;var c=" ";c=">>>";var s=n.createSelectorQuery().in(i._in?i._in.page:i).select((i._in?i._in.selector:"._root")+(e?"".concat(c,"#").concat(e):"")).boundingClientRect();i._in?s.select(i._in.selector).scrollOffset().select(i._in.selector).boundingClientRect():s.selectViewport().scrollOffset(),s.exec((function(e){if(!e[0])return o("Label not found");var c=e[1].scrollTop+e[0].top-(e[2]?e[2].top:0)+t;i._in?i._in.page[i._in.scrollTop]=c:n.pageScrollTo({scrollTop:c,duration:300}),r()}))}))},getText:function(){var n="";return function e(t){for(var i=0;i<t.length;i++){var r=t[i];if("text"==r.type)n+=r.text.replace(/&amp;/g,"&");else if("br"==r.name)n+="\n";else{var o="p"==r.name||"div"==r.name||"tr"==r.name||"li"==r.name||"h"==r.name[0]&&r.name[1]>"0"&&r.name[1]<"7";o&&n&&"\n"!=n[n.length-1]&&(n+="\n"),r.children&&e(r.children),o&&"\n"!=n[n.length-1]?n+="\n":"td"!=r.name&&"th"!=r.name||(n+="\t")}}}(this.nodes),n},getRect:function(){var e=this;return new Promise((function(t,i){n.createSelectorQuery().in(e).select("#_root").boundingClientRect().exec((function(n){return n[0]?t(n[0]):i("Root label not found")}))}))},setContent:function(n,e){var t=this;e&&this.imgList||(this.imgList=[]);var i,r=new c(this).parse(n);this.$set(this,"nodes",e?(this.nodes||[]).concat(r):r),this._videos=[],this.$nextTick((function(){t._hook("onLoad"),t.$emit("load")})),clearInterval(this._timer),this._timer=setInterval((function(){t.getRect().then((function(n){n.height==i&&(t.$emit("ready",n),clearInterval(t._timer)),i=n.height})).catch((function(){}))}),350)},_hook:function(n){for(var e=o.length;e--;)this.plugins[e][n]&&this.plugins[e][n]()}}};e.default=u}).call(this,t(2)["default"])},400:function(n,e,t){"use strict";t.r(e);var i=t(401),r=t.n(i);for(var o in i)["default"].indexOf(o)<0&&function(n){t.d(e,n,(function(){return i[n]}))}(o);e["default"]=r.a},401:function(n,e,t){}}]);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/uview-ui/components/u-parse/u-parse.js.map
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'uview-ui/components/u-parse/u-parse-create-component',
{
'uview-ui/components/u-parse/u-parse-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('2')['createComponent'](__webpack_require__(393))
})
},
[['uview-ui/components/u-parse/u-parse-create-component']]
]);