{"remainingRequest":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\artfess-module\\src\\components\\AnchorWrapper.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\artfess-module\\src\\components\\AnchorWrapper.vue","mtime":1675232038543},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nexport default {\r\n props: {\r\n anchors: Array\r\n },\r\n data() {\r\n return {\r\n array: []\r\n };\r\n },\r\n computed: {\r\n anchorAry: function() {\r\n if (this.array && this.array.length > 0) {\r\n return this.array;\r\n }\r\n this.anchors &&\r\n this.anchors.forEach(item => {\r\n this.array.push(Object.assign({ selected: false }, item));\r\n });\r\n return this.array;\r\n }\r\n },\r\n mounted() {\r\n this.$route.hash && this.updateTarget(this.$route.hash);\r\n this.$router.afterEach((to, from) => {\r\n to.hash && this.updateTarget(to.hash);\r\n });\r\n },\r\n methods: {\r\n wrapperClick: function(e) {\r\n e.target.hash && this.updateTarget(e.target.hash);\r\n },\r\n updateTarget: function(t) {\r\n if (!t || t.constructor != String) {\r\n return;\r\n }\r\n let index = t.lastIndexOf(\"#\");\r\n if ( index != -1) {\r\n t = t.substr(index + 1);\r\n }\r\n this.anchorAry.forEach(item => {\r\n if (item.alias == t) {\r\n item.selected = true;\r\n } else {\r\n item.selected = false;\r\n }\r\n });\r\n },\r\n genHref(anchor){\r\n if(this.$router.mode==\"history\"){\r\n return \"#\"+anchor;\r\n }\r\n return \"/#\"+this.$route.path+\"#\" + anchor;\r\n }\r\n }\r\n};\r\n",null]}