u-parse.js.map 9.7 KB
{"version":3,"sources":["webpack:///G:/项目/program/tigerprogram/components/u-parse/u-parse.vue?b0e4","webpack:///G:/项目/program/tigerprogram/components/u-parse/u-parse.vue?7d8b","webpack:///G:/项目/program/tigerprogram/components/u-parse/u-parse.vue?6dd4","webpack:///G:/项目/program/tigerprogram/components/u-parse/u-parse.vue?bbd2","webpack:///G:/项目/program/tigerprogram/components/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;AAAsF;AAC3B;AACL;;;AAGtD;AAC4H;AAC5H,gBAAgB,0IAAU;AAC1B,EAAE,6EAAM;AACR,EAAE,kFAAM;AACR,EAAE,2FAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;ACtCf;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACNA;AAAA;AAAA;AAAA;AAAmsB,CAAgB,otBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkBvtB,0F,8FAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;mSAKe,EACbA,IAAI,EAAE,SADO,EAEbC,KAAK,EAAE,EACLC,OAAO,EAAE,EACPC,IAAI,EAAEC,OADC,EAEPC,OAAO,EAAE,KAFF,EADJ,EAKLC,SAAS,EAAE,EACTH,IAAI,EAAEI,MADG,EAETF,OAAO,EA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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":"components/u-parse/u-parse.js","sourcesContent":["import { render, staticRenderFns } from \"./u-parse.vue?vue&type=template&id=4c06769e&\"\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 \"!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\runtime\\\\componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\n/* hot reload */\nif (module.hot) {\n  var api = require(\"F:\\\\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 (!module.hot.data) {\n      api.createRecord('4c06769e', component.options)\n    } else {\n      api.reload('4c06769e', component.options)\n    }\n    module.hot.accept(\"./u-parse.vue?vue&type=template&id=4c06769e&\", function () {\n      api.rerender('4c06769e', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"G:/项目/program/tigerprogram/components/u-parse/u-parse.vue\"\nexport default component.exports","export * from \"-!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--16-0!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-custom-block-loader\\\\index.js??ref--0-1!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./u-parse.vue?vue&type=template&id=4c06769e&\"","var render = function() {\n  var _vm = this\n  var _h = _vm.$createElement\n  var _c = _vm._self._c || _h\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import mod from \"-!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-custom-block-loader\\\\index.js??ref--0-1!F:\\\\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 \"-!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-custom-block-loader\\\\index.js??ref--0-1!F:\\\\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":""}