eeeeeeuuuu-ui
Version:
uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
12 lines (11 loc) • 3.51 kB
JavaScript
require('../../../../app.js');
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uview-ui/components/u-parse/libs/trees"],{5160:function(t,e,s){"use strict";var i=s("b41d"),r=s.n(i);r.a},7320:function(t,e,s){"use strict";(function(t,i){t.Parser={};var r=function(){Promise.resolve().then((()=>resolve(s("c087"))).bind(null,s)).catch(s.oe)};const a=s("0b0a").errorImg;e["a"]={components:{trees:r},name:"trees",data(){return{ctrl:[],placeholder:'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="225"/>',errorImg:a,loadVideo:"undefined"==typeof plus,c:"",s:""}},props:{nodes:Array,lazyLoad:Boolean,loading:String},mounted(){for(this.top=this.$parent;"parser"!=this.top.$options.name;this.top=this.top.$parent);this.init()},methods:{init(){for(var t,e=this.nodes.length;t=this.nodes[--e];)if("img"==t.name)this.top.imgList.setItem(t.attrs.i,t.attrs.src);else if("video"==t.name||"audio"==t.name){var s;"video"==t.name?s=i.createVideoContext(t.attrs.id,this):this.$refs[t.attrs.id]&&(s=this.$refs[t.attrs.id][0]),s&&(s.id=t.attrs.id,this.top.videoContexts.push(s))}},play(t){var e=this.top.videoContexts;if(e.length>1&&this.top.autopause)for(var s=e.length;s--;)e[s].id!=t.currentTarget.dataset.id&&e[s].pause()},imgtap(e){var s=e.currentTarget.dataset.attrs;if(!s.ignore){var r=!0,a={id:e.target.id,src:s.src,ignore:()=>r=!1};if(t.Parser.onImgtap&&t.Parser.onImgtap(a),this.top.$emit("imgtap",a),r){var o=this.top.imgList,n=o[s.i]?parseInt(s.i):(o=[s.src],0);i.previewImage({current:n,urls:o})}}},loadImg(t){var e=t.currentTarget.dataset.i;this.lazyLoad&&!this.ctrl[e]?this.$set(this.ctrl,e,1):this.loading&&2!=this.ctrl[e]&&this.$set(this.ctrl,e,2)},linkpress(e){var s=!0,r=e.currentTarget.dataset.attrs;if(r.ignore=()=>s=!1,t.Parser.onLinkpress&&t.Parser.onLinkpress(r),this.top.$emit("linkpress",r),s){if(r["app-id"])return i.navigateToMiniProgram({appId:r["app-id"],path:r.path});r.href&&("#"==r.href[0]?this.top.useAnchor&&this.top.navigateTo({id:r.href.substring(1)}):0==r.href.indexOf("http")||0==r.href.indexOf("//")?i.setClipboardData({data:r.href,success:()=>i.showToast({title:"链接已复制"})}):i.navigateTo({url:r.href,fail(){i.switchTab({url:r.href})}}))}},error(t){var e=t.currentTarget,s=e.dataset.source,i=e.dataset.i;if("video"==s||"audio"==s){var r=this.ctrl[i]?this.ctrl[i].i+1:1;r<this.nodes[i].attrs.source.length&&this.$set(this.ctrl,i,r),t.detail.__args__&&(t.detail=t.detail.__args__[0])}else a&&"img"==s&&(this.top.imgList.setItem(e.dataset.index,a),this.$set(this.ctrl,i,3));this.top&&this.top.$emit("error",{source:s,target:e,errMsg:t.detail.errMsg})},_loadVideo(t){this.$set(this.ctrl,t.target.dataset.i,0)}}}}).call(this,s("c8ba"),s("543d")["default"])},b41d:function(t,e,s){},c087:function(t,e,s){"use strict";var i;s.r(e);var r,a=function(){var t=this,e=t.$createElement;t._self._c},o=[],n=s("7320"),h=n["a"],d=(s("5160"),s("f0c5")),l=function(t){t.options.wxsCallMethods||(t.options.wxsCallMethods=[])},p=l,c=Object(d["a"])(h,a,o,!1,null,null,null,!1,i,r);"function"===typeof p&&p(c);e["default"]=c.exports}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'uview-ui/components/u-parse/libs/trees-create-component',
{
'uview-ui/components/u-parse/libs/trees-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('543d')['createComponent'](__webpack_require__("c087"))
})
},
[['uview-ui/components/u-parse/libs/trees-create-component']]
]);