u-parse.js.map 9.8 KB
{"version":3,"sources":["webpack:///E:/项目/tigerprogram/componentsk/u-parse/u-parse.vue?c109","webpack:///E:/项目/tigerprogram/componentsk/u-parse/u-parse.vue?858f","webpack:///E:/项目/tigerprogram/componentsk/u-parse/u-parse.vue?67fd","webpack:///E:/项目/tigerprogram/componentsk/u-parse/u-parse.vue?b346","webpack:///E:/项目/tigerprogram/componentsk/u-parse/u-parse.vue"],"names":["name","props","loading","type","Boolean","default","className","String","content","noData","startHandler","Function","node","attr","class","style","endHandler","charsHandler","imageProp","Object","mode","padding","lazyLoad","domain","components","wxParseTemplate","data","imageUrls","computed","nodes","parseData","customHandler","start","end","chars","results","console","log","methods","navigate","href","$event","$emit","preview","src","length","wx","previewImage","current","urls","removeImageUrl","splice","indexOf"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAoH;AACpH;AAC2D;AACL;;;AAGtD;AACqK;AACrK,gBAAgB,+KAAU;AAC1B,EAAE,6EAAM;AACR,EAAE,kFAAM;AACR,EAAE,2FAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,sFAAU;AACZ;AACA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;ACzCf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACRA;AAAA;AAAA;AAAA;AAAimB,CAAgB,2nBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkBrnB,0F,8FAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;qSAKe,EACbA,IAAI,EAAE,SADO,EAEbC,KAAK,EAAE,EACLC,OAAO,EAAE,EACPC,IAAI,EAAEC,OADC,EAEPC,OAAO,EA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,YAPI;AASN,UAAMa,SAAS,GAAGtB,OAAO,IAAIC,MAA7B;AACA,UAAMsB,aAAa,GAAG;AACpBC,aAAK,EAAEtB,YADa;AAEpBuB,WAAG,EAAEjB,UAFe;AAGpBkB,aAAK,EAAEjB,YAHa,EAAtB;;AAKA,UAAMkB,OAAO,GAAG,wBAAWL,SAAX,EAAsBC,aAAtB,EAAqCb,SAArC,EAAgD,IAAhD,CAAhB;AACA,WAAKS,SAAL,GAAiBQ,OAAO,CAACR,SAAzB;AACAS,aAAO,CAACC,GAAR,CAAYF,OAAZ;AACA,aAAOA,OAAO,CAACN,KAAf;AACD,KApBO,EAxDG;;AA8EbS,SAAO,EAAE;AACPC,YADO,oBACEC,IADF,EACQC,MADR,EACgB;AACrB,WAAKC,KAAL,CAAW,UAAX,EAAuBF,IAAvB,EAA6BC,MAA7B;AACD,KAHM;AAIPE,WAJO,mBAICC,GAJD,EAIMH,MAJN,EAIc;AACnB,UAAI,CAAC,KAAKd,SAAL,CAAekB,MAApB,EAA4B;AAC5BC,QAAE,CAACC,YAAH,CAAgB;AACdC,eAAO,EAAEJ,GADK;AAEdK,YAAI,EAAE,KAAKtB,SAFG,EAAhB;;AAIA,WAAKe,KAAL,CAAW,SAAX,EAAsBE,GAAtB,EAA2BH,MAA3B;AACD,KAXM;AAYPS,kBAZO,0BAYQN,GAZR,EAYa;AACVjB,eADU,GACI,IADJ,CACVA,SADU;AAElBA,eAAS,CAACwB,MAAV,CAAiBxB,SAAS,CAACyB,OAAV,CAAkBR,GAAlB,CAAjB,EAAyC,CAAzC;AACD,KAfM,EA9EI,E","file":"componentsk/u-parse/u-parse.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./u-parse.vue?vue&type=template&id=2a0748d1&\"\nvar renderjs\nimport script from \"./u-parse.vue?vue&type=script&lang=js&\"\nexport * from \"./u-parse.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\runtime\\\\componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null,\n  false,\n  components,\n  renderjs\n)\n\n/* hot reload */\nif (module.hot) {\n  var api = require(\"D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n  api.install(require('vue'))\n  if (api.compatible) {\n    module.hot.accept()\n    if (!api.isRecorded('2a0748d1')) {\n      api.createRecord('2a0748d1', component.options)\n    } else {\n      api.reload('2a0748d1', component.options)\n    }\n    module.hot.accept(\"./u-parse.vue?vue&type=template&id=2a0748d1&\", function () {\n      api.rerender('2a0748d1', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"E:/项目/tigerprogram/componentsk/u-parse/u-parse.vue\"\nexport default component.exports","export * from \"-!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--16-0!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-uni-app-loader\\\\page-meta.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./u-parse.vue?vue&type=template&id=2a0748d1&\"","var components\nvar render = function() {\n  var _vm = this\n  var _h = _vm.$createElement\n  var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./u-parse.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./u-parse.vue?vue&type=script&lang=js&\"","//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n\r\nimport HtmlToJson from './libs/html2json';\r\nimport wxParseTemplate from './components/wxParseTemplate0';\r\n\r\nexport default {\r\n  name: 'wxParse',\r\n  props: {\r\n    loading: {\r\n      type: Boolean,\r\n      default: false,\r\n    },\r\n    className: {\r\n      type: String,\r\n      default: '',\r\n    },\r\n    content: {\r\n      type: String,\r\n      default: '',\r\n    },\r\n    noData: {\r\n      type: String,\r\n      default: '<div style=\"color: red;\">数据不能为空</div>',\r\n    },\r\n    startHandler: {\r\n      type: Function,\r\n      default() {\r\n        return (node) => {\r\n          node.attr.class = null;\r\n          node.attr.style = null;\r\n        };\r\n      },\r\n    },\r\n    endHandler: {\r\n      type: Function,\r\n      default: null,\r\n    },\r\n    charsHandler: {\r\n      type: Function,\r\n      default: null,\r\n    },\r\n    imageProp: {\r\n      type: Object,\r\n      default() {\r\n        return {\r\n          mode: 'aspectFit',\r\n          padding: 0,\r\n          lazyLoad: false,\r\n          domain: '',\r\n        };\r\n      },\r\n    },\r\n  },\r\n  components: {\r\n    wxParseTemplate,\r\n  },\r\n  data() {\r\n    return {\r\n      imageUrls: [],\r\n    };\r\n  },\r\n  computed: {\r\n    nodes() {\r\n      const {\r\n        content,\r\n        noData,\r\n        imageProp,\r\n        startHandler,\r\n        endHandler,\r\n        charsHandler,\r\n      } = this;\r\n      const parseData = content || noData;\r\n      const customHandler = {\r\n        start: startHandler,\r\n        end: endHandler,\r\n        chars: charsHandler,\r\n      };\r\n      const results = HtmlToJson(parseData, customHandler, imageProp, this);\r\n      this.imageUrls = results.imageUrls;\r\n      console.log(results)\r\n      return results.nodes;\r\n    },\r\n  },\r\n  methods: {\r\n    navigate(href, $event) {\r\n      this.$emit('navigate', href, $event);\r\n    },\r\n    preview(src, $event) {\r\n      if (!this.imageUrls.length) return;\r\n      wx.previewImage({\r\n        current: src,\r\n        urls: this.imageUrls,\r\n      });\r\n      this.$emit('preview', src, $event);\r\n    },\r\n    removeImageUrl(src) {\r\n      const { imageUrls } = this;\r\n      imageUrls.splice(imageUrls.indexOf(src), 1);\r\n    },\r\n  },\r\n};\r\n"],"sourceRoot":""}