liusuyi
2024-10-10 38f29e38fcc668171dc05c53d40a36b895c86102
1
{"remainingRequest":"D:\\workspace\\idea\\ruoyi-api\\ruoyi-ui\\node_modules\\babel-loader\\lib\\index.js!D:\\workspace\\idea\\ruoyi-api\\ruoyi-ui\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\workspace\\idea\\ruoyi-api\\ruoyi-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\workspace\\idea\\ruoyi-api\\ruoyi-ui\\src\\layout\\components\\Sidebar\\Link.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\workspace\\idea\\ruoyi-api\\ruoyi-ui\\src\\layout\\components\\Sidebar\\Link.vue","mtime":1683257485726},{"path":"D:\\workspace\\idea\\ruoyi-api\\ruoyi-ui\\babel.config.js","mtime":1683257214499},{"path":"D:\\workspace\\idea\\ruoyi-api\\ruoyi-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1683257226511},{"path":"D:\\workspace\\idea\\ruoyi-api\\ruoyi-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1683257224897},{"path":"D:\\workspace\\idea\\ruoyi-api\\ruoyi-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1683257226511},{"path":"D:\\workspace\\idea\\ruoyi-api\\ruoyi-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1683257451742}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:InVzZSBzdHJpY3QiOwoKT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICJfX2VzTW9kdWxlIiwgewogIHZhbHVlOiB0cnVlCn0pOwpleHBvcnRzLmRlZmF1bHQgPSB2b2lkIDA7CnZhciBfdmFsaWRhdGUgPSByZXF1aXJlKCJAL3V0aWxzL3ZhbGlkYXRlIik7Ci8vCi8vCi8vCi8vCi8vCi8vCnZhciBfZGVmYXVsdCA9IHsKICBwcm9wczogewogICAgdG86IHsKICAgICAgdHlwZTogW1N0cmluZywgT2JqZWN0XSwKICAgICAgcmVxdWlyZWQ6IHRydWUKICAgIH0KICB9LAogIGNvbXB1dGVkOiB7CiAgICBpc0V4dGVybmFsOiBmdW5jdGlvbiBpc0V4dGVybmFsKCkgewogICAgICByZXR1cm4gKDAsIF92YWxpZGF0ZS5pc0V4dGVybmFsKSh0aGlzLnRvKTsKICAgIH0sCiAgICB0eXBlOiBmdW5jdGlvbiB0eXBlKCkgewogICAgICBpZiAodGhpcy5pc0V4dGVybmFsKSB7CiAgICAgICAgcmV0dXJuICdhJzsKICAgICAgfQogICAgICByZXR1cm4gJ3JvdXRlci1saW5rJzsKICAgIH0KICB9LAogIG1ldGhvZHM6IHsKICAgIGxpbmtQcm9wczogZnVuY3Rpb24gbGlua1Byb3BzKHRvKSB7CiAgICAgIGlmICh0aGlzLmlzRXh0ZXJuYWwpIHsKICAgICAgICByZXR1cm4gewogICAgICAgICAgaHJlZjogdG8sCiAgICAgICAgICB0YXJnZXQ6ICdfYmxhbmsnLAogICAgICAgICAgcmVsOiAnbm9vcGVuZXInCiAgICAgICAgfTsKICAgICAgfQogICAgICByZXR1cm4gewogICAgICAgIHRvOiB0bwogICAgICB9OwogICAgfQogIH0KfTsKZXhwb3J0cy5kZWZhdWx0ID0gX2RlZmF1bHQ7"},{"version":3,"mappings":";;;;;;AAOA;;;;;;;eAEA;EACAA;IACAC;MACAC;MACAC;IACA;EACA;EACAC;IACAC;MACA;IACA;IACAH;MACA;QACA;MACA;MACA;IACA;EACA;EACAI;IACAC;MACA;QACA;UACAC;UACAC;UACAC;QACA;MACA;MACA;QACAT;MACA;IACA;EACA;AACA;AAAA","names":["props","to","type","required","computed","isExternal","methods","linkProps","href","target","rel"],"sourceRoot":"src/layout/components/Sidebar","sources":["Link.vue"],"sourcesContent":["<template>\r\n  <component :is=\"type\" v-bind=\"linkProps(to)\">\r\n    <slot />\r\n  </component>\r\n</template>\r\n\r\n<script>\r\nimport { isExternal } from '@/utils/validate'\r\n\r\nexport default {\r\n  props: {\r\n    to: {\r\n      type: [String, Object],\r\n      required: true\r\n    }\r\n  },\r\n  computed: {\r\n    isExternal() {\r\n      return isExternal(this.to)\r\n    },\r\n    type() {\r\n      if (this.isExternal) {\r\n        return 'a'\r\n      }\r\n      return 'router-link'\r\n    }\r\n  },\r\n  methods: {\r\n    linkProps(to) {\r\n      if (this.isExternal) {\r\n        return {\r\n          href: to,\r\n          target: '_blank',\r\n          rel: 'noopener'\r\n        }\r\n      }\r\n      return {\r\n        to: to\r\n      }\r\n    }\r\n  }\r\n}\r\n</script>\r\n"]}]}