@luzhaoqi/test 0.0.26 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/lib-cjs.js +21 -7
  2. package/package.json +3 -2
package/dist/lib-cjs.js CHANGED
@@ -96765,8 +96765,14 @@ __vue_component__$1.install = function (Vue, option = {}) {
96765
96765
  //
96766
96766
  //
96767
96767
  //
96768
+ //
96768
96769
 
96769
96770
 
96771
+ const aaa = {
96772
+ 404: require('./svg/404.svg'),
96773
+ password: require('./svg/password.svg'),
96774
+ user: require('./svg/user.svg')
96775
+ };
96770
96776
  var script = {
96771
96777
  name: 'z-svg-icon',
96772
96778
  props: {
@@ -96784,7 +96790,9 @@ var script = {
96784
96790
  return isExternal(this.iconClass)
96785
96791
  },
96786
96792
  iconName() {
96787
- return `#icon-${this.iconClass}`
96793
+ return aaa[this.iconClass]
96794
+ // return `#icon-${this.iconClass}`
96795
+ // return `#icon-${this.iconClass}`
96788
96796
  },
96789
96797
  svgClass() {
96790
96798
  if (this.className) {
@@ -96822,12 +96830,11 @@ var __vue_render__ = function () {
96822
96830
  )
96823
96831
  )
96824
96832
  : _c(
96825
- "svg",
96833
+ "img",
96826
96834
  _vm._g(
96827
- { class: _vm.svgClass, attrs: { "aria-hidden": "true" } },
96835
+ { class: _vm.svgClass, attrs: { src: _vm.iconName, alt: "" } },
96828
96836
  _vm.$listeners
96829
- ),
96830
- [_c("use", { attrs: { "xlink:href": _vm.iconName } })]
96837
+ )
96831
96838
  )
96832
96839
  };
96833
96840
  var __vue_staticRenderFns__ = [];
@@ -96836,11 +96843,11 @@ __vue_render__._withStripped = true;
96836
96843
  /* style */
96837
96844
  const __vue_inject_styles__ = function (inject) {
96838
96845
  if (!inject) return
96839
- inject("data-v-4874b61c_0", { source: "\n.svg-icon[data-v-4874b61c] {\r\n width: 1em;\r\n height: 1em;\r\n vertical-align: -0.15em;\r\n fill: currentColor;\r\n overflow: hidden;\n}\n.svg-external-icon[data-v-4874b61c] {\r\n background-color: currentColor;\r\n mask-size: cover !important;\r\n display: inline-block;\n}\r\n", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\svg-icon\\icon.vue"],"names":[],"mappings":";AA+CA;EACA,UAAA;EACA,WAAA;EACA,uBAAA;EACA,kBAAA;EACA,gBAAA;AACA;AAEA;EACA,8BAAA;EACA,2BAAA;EACA,qBAAA;AACA","file":"icon.vue","sourcesContent":["<template>\r\n <div v-if=\"isExternal\" :style=\"styleExternalIcon\" class=\"svg-external-icon svg-icon\" v-on=\"$listeners\" />\r\n <svg v-else :class=\"svgClass\" aria-hidden=\"true\" v-on=\"$listeners\">\r\n <use :xlink:href=\"iconName\" />\r\n </svg>\r\n</template>\r\n\r\n<script>\r\nimport { isExternal } from '../../utils/utils'\r\n\r\nexport default {\r\n name: 'z-svg-icon',\r\n props: {\r\n iconClass: {\r\n type: String,\r\n required: true\r\n },\r\n className: {\r\n type: String,\r\n default: ''\r\n }\r\n },\r\n computed: {\r\n isExternal() {\r\n return isExternal(this.iconClass)\r\n },\r\n iconName() {\r\n return `#icon-${this.iconClass}`\r\n },\r\n svgClass() {\r\n if (this.className) {\r\n return 'svg-icon ' + this.className\r\n } else {\r\n return 'svg-icon'\r\n }\r\n },\r\n styleExternalIcon() {\r\n return {\r\n mask: `url(${this.iconClass}) no-repeat 50% 50%`,\r\n '-webkit-mask': `url(${this.iconClass}) no-repeat 50% 50%`\r\n }\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped>\r\n.svg-icon {\r\n width: 1em;\r\n height: 1em;\r\n vertical-align: -0.15em;\r\n fill: currentColor;\r\n overflow: hidden;\r\n}\r\n\r\n.svg-external-icon {\r\n background-color: currentColor;\r\n mask-size: cover !important;\r\n display: inline-block;\r\n}\r\n</style>\r\n"]}, media: undefined });
96846
+ inject("data-v-513deca2_0", { source: "\n.svg-icon[data-v-513deca2] {\r\n width: 1em;\r\n height: 1em;\r\n vertical-align: -0.15em;\r\n fill: currentColor;\r\n overflow: hidden;\n}\n.svg-external-icon[data-v-513deca2] {\r\n background-color: currentColor;\r\n mask-size: cover !important;\r\n display: inline-block;\n}\r\n", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\svg-icon\\icon.vue"],"names":[],"mappings":";AAuDA;EACA,UAAA;EACA,WAAA;EACA,uBAAA;EACA,kBAAA;EACA,gBAAA;AACA;AACA;EACA,8BAAA;EACA,2BAAA;EACA,qBAAA;AACA","file":"icon.vue","sourcesContent":["<template>\r\n <div v-if=\"isExternal\" :style=\"styleExternalIcon\" class=\"svg-external-icon svg-icon\" v-on=\"$listeners\" />\r\n <img v-else :src=\"iconName\" alt=\"\" :class=\"svgClass\" v-on=\"$listeners\" />\r\n <!-- <svg v-else :class=\"svgClass\" aria-hidden=\"true\" v-on=\"$listeners\">-->\r\n <!-- <use :xlink:href=\"iconName\" />-->\r\n <!-- </svg>-->\r\n</template>\r\n\r\n<script>\r\nimport { isExternal } from '../../utils/utils'\r\n\r\nconst aaa = {\r\n 404: require('./svg/404.svg'),\r\n password: require('./svg/password.svg'),\r\n user: require('./svg/user.svg')\r\n}\r\nexport default {\r\n name: 'z-svg-icon',\r\n props: {\r\n iconClass: {\r\n type: String,\r\n required: true\r\n },\r\n className: {\r\n type: String,\r\n default: ''\r\n }\r\n },\r\n computed: {\r\n isExternal() {\r\n return isExternal(this.iconClass)\r\n },\r\n iconName() {\r\n return aaa[this.iconClass]\r\n // return `#icon-${this.iconClass}`\r\n // return `#icon-${this.iconClass}`\r\n },\r\n svgClass() {\r\n if (this.className) {\r\n return 'svg-icon ' + this.className\r\n } else {\r\n return 'svg-icon'\r\n }\r\n },\r\n styleExternalIcon() {\r\n return {\r\n mask: `url(${this.iconClass}) no-repeat 50% 50%`,\r\n '-webkit-mask': `url(${this.iconClass}) no-repeat 50% 50%`\r\n }\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped>\r\n.svg-icon {\r\n width: 1em;\r\n height: 1em;\r\n vertical-align: -0.15em;\r\n fill: currentColor;\r\n overflow: hidden;\r\n}\r\n.svg-external-icon {\r\n background-color: currentColor;\r\n mask-size: cover !important;\r\n display: inline-block;\r\n}\r\n</style>\r\n"]}, media: undefined });
96840
96847
 
96841
96848
  };
96842
96849
  /* scoped */
96843
- const __vue_scope_id__ = "data-v-4874b61c";
96850
+ const __vue_scope_id__ = "data-v-513deca2";
96844
96851
  /* module identifier */
96845
96852
  const __vue_module_identifier__ = undefined;
96846
96853
  /* functional template */
@@ -96867,6 +96874,13 @@ __vue_render__._withStripped = true;
96867
96874
  __vue_component__.install = function (Vue, option = {}) {
96868
96875
  setGolbalData(Vue, option);
96869
96876
  Vue.component(__vue_component__.name, __vue_component__);
96877
+ const req = require.context('./svg', false, /\.svg$/);
96878
+ const requireAll = (requireContext) => {
96879
+ console.log(requireContext.keys());
96880
+ console.log(requireContext.keys().map(requireContext));
96881
+ return requireContext.keys().map(requireContext)
96882
+ };
96883
+ requireAll(req);
96870
96884
  };
96871
96885
 
96872
96886
  if (typeof window !== 'undefined' && window.Vue) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luzhaoqi/test",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "private": false,
5
5
  "main": "dist/lib-cjs.js",
6
6
  "scripts": {
@@ -50,6 +50,7 @@
50
50
  "rollup-plugin-vue": "~5.0.0",
51
51
  "sass": "^1.32.7",
52
52
  "sass-loader": "^12.0.0",
53
- "vue-template-compiler": "^2.6.14"
53
+ "vue-template-compiler": "^2.6.14",
54
+ "svg-sprite-loader": "5.1.1"
54
55
  }
55
56
  }