Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

v-highlight-component

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v-highlight-component - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

8

dist/v-highlight-component.common.js

@@ -613,3 +613,3 @@ module.exports =

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"655f791a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/highlight.vue?vue&type=template&id=10dc08fa&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"23cc7f6c-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/highlight.vue?vue&type=template&id=55911e93&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.tag,{tag:"component",staticClass:"highlight-content"},[_vm._l((_vm.operateMessage),function(item){return [_vm._v(_vm._s(item.message)),_c('span',{staticClass:"highlight"},[_vm._v(_vm._s(item.word))])]})],2)}

@@ -619,3 +619,3 @@ var staticRenderFns = []

// CONCATENATED MODULE: ./src/highlight.vue?vue&type=template&id=10dc08fa&
// CONCATENATED MODULE: ./src/highlight.vue?vue&type=template&id=55911e93&

@@ -640,3 +640,3 @@ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/highlight.vue?vue&type=script&lang=js&

// 要高亮的关键字数组
selectedArray:{
search:{
type: Array,

@@ -662,3 +662,3 @@ default(){

let resultArray = [{word:'',message:this.message}];
this.selectedArray.forEach(selectedWord=>{
this.search.forEach(selectedWord=>{
const store = [];

@@ -665,0 +665,0 @@ resultArray.forEach(({word,message})=>{

@@ -622,3 +622,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"655f791a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/highlight.vue?vue&type=template&id=10dc08fa&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"23cc7f6c-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/highlight.vue?vue&type=template&id=55911e93&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.tag,{tag:"component",staticClass:"highlight-content"},[_vm._l((_vm.operateMessage),function(item){return [_vm._v(_vm._s(item.message)),_c('span',{staticClass:"highlight"},[_vm._v(_vm._s(item.word))])]})],2)}

@@ -628,3 +628,3 @@ var staticRenderFns = []

// CONCATENATED MODULE: ./src/highlight.vue?vue&type=template&id=10dc08fa&
// CONCATENATED MODULE: ./src/highlight.vue?vue&type=template&id=55911e93&

@@ -649,3 +649,3 @@ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/highlight.vue?vue&type=script&lang=js&

// 要高亮的关键字数组
selectedArray:{
search:{
type: Array,

@@ -671,3 +671,3 @@ default(){

let resultArray = [{word:'',message:this.message}];
this.selectedArray.forEach(selectedWord=>{
this.search.forEach(selectedWord=>{
const store = [];

@@ -674,0 +674,0 @@ resultArray.forEach(({word,message})=>{

@@ -1,2 +0,2 @@

(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["v-highlight-component"]=t():e["v-highlight-component"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"24fb":function(e,t,n){"use strict";function r(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"===typeof btoa){var i=o(r),s=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(s).concat([i]).join("\n")}return[n].join("\n")}function o(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=r(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"===typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var s=this[i][0];null!=s&&(o[s]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},"499e":function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],s=i[0],a=i[1],c=i[2],u=i[3],f={id:e+":"+o,css:a,media:c,sourceMap:u};r[s]?r[s].parts.push(f):n.push(r[s]={id:s,parts:[f]})}return n}n.r(t),n.d(t,"default",(function(){return h}));var o="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!o)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var i={},s=o&&(document.head||document.getElementsByTagName("head")[0]),a=null,c=0,u=!1,f=function(){},d=null,l="data-vue-ssr-id",p="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function h(e,t,n,o){u=n,d=o||{};var s=r(e,t);return g(s),function(t){for(var n=[],o=0;o<s.length;o++){var a=s[o],c=i[a.id];c.refs--,n.push(c)}t?(s=r(e,t),g(s)):s=[];for(o=0;o<n.length;o++){c=n[o];if(0===c.refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete i[c.id]}}}}function g(e){for(var t=0;t<e.length;t++){var n=e[t],r=i[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(m(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var s=[];for(o=0;o<n.parts.length;o++)s.push(m(n.parts[o]));i[n.id]={id:n.id,refs:1,parts:s}}}}function v(){var e=document.createElement("style");return e.type="text/css",s.appendChild(e),e}function m(e){var t,n,r=document.querySelector("style["+l+'~="'+e.id+'"]');if(r){if(u)return f;r.parentNode.removeChild(r)}if(p){var o=c++;r=a||(a=v()),t=b.bind(null,r,o,!1),n=b.bind(null,r,o,!0)}else r=v(),t=_.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}var y=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function b(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=y(t,o);else{var i=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function _(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute("media",r),d.ssrId&&e.setAttribute(l,t.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{while(e.firstChild)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},"5e51":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".highlight-content .highlight{color:red}",""]),e.exports=t},8875:function(e,t,n){var r,o,i;(function(n,s){o=[],r=s,i="function"===typeof r?r.apply(t,o):r,void 0===i||(e.exports=i)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,o,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,s=/@([^@]*):(\d+):(\d+)\s*$/gi,a=i.exec(p.stack)||s.exec(p.stack),c=a&&a[1]||!1,u=a&&a[2]||!1,f=document.location.href.replace(document.location.hash,""),d=document.getElementsByTagName("script");c===f&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(u-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(r,"$1").trim());for(var l=0;l<d.length;l++){if("interactive"===d[l].readyState)return d[l];if(d[l].src===c)return d[l];if(c===f&&d[l].innerHTML&&d[l].innerHTML.trim()===o)return d[l]}return null}}return e}))},a4bd:function(e,t,n){"use strict";n("d9aa")},d9aa:function(e,t,n){var r=n("5e51");"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var o=n("499e").default;o("7f217893",r,!0,{sourceMap:!1,shadowMode:!1})},fb15:function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(e.tag,{tag:"component",staticClass:"highlight-content"},[e._l(e.operateMessage,(function(t){return[e._v(e._s(t.message)),n("span",{staticClass:"highlight"},[e._v(e._s(t.word))])]}))],2)},a=[],c={name:"highlight",props:{selectedArray:{type:Array,default(){return[]}},message:{type:String,default:""},tag:{type:String,default:"div"}},computed:{operateMessage(){let e=[{word:"",message:this.message}];return this.selectedArray.forEach(t=>{const n=[];e.forEach(({word:e,message:r})=>{const o=this.splitMessage(r,t);o.length>0?(n.push(...o),n.push({word:e,message:""})):n.push({word:e,message:r})}),e=n}),e.filter(({word:e,message:t})=>""!==e||""!==t)}},methods:{splitMessage(e,t){const n=[],r=e.split(t);r.forEach(e=>{n.push({message:e,word:t})});const o=n.length;return o>0&&(n[o-1].word=""),n}}},u=c;n("a4bd");function f(e,t,n,r,o,i,s,a){var c,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),s?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=c):o&&(c=a?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(u.functional){u._injectStyles=c;var f=u.render;u.render=function(e,t){return c.call(t),f(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:u}}var d=f(u,s,a,!1,null,null,null),l=d.exports;t["default"]=l}})["default"]}));
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["v-highlight-component"]=t():e["v-highlight-component"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"24fb":function(e,t,n){"use strict";function r(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"===typeof btoa){var i=o(r),s=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(s).concat([i]).join("\n")}return[n].join("\n")}function o(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=r(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"===typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var s=this[i][0];null!=s&&(o[s]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},"499e":function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],s=i[0],a=i[1],c=i[2],u=i[3],f={id:e+":"+o,css:a,media:c,sourceMap:u};r[s]?r[s].parts.push(f):n.push(r[s]={id:s,parts:[f]})}return n}n.r(t),n.d(t,"default",(function(){return h}));var o="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!o)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var i={},s=o&&(document.head||document.getElementsByTagName("head")[0]),a=null,c=0,u=!1,f=function(){},d=null,l="data-vue-ssr-id",p="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function h(e,t,n,o){u=n,d=o||{};var s=r(e,t);return g(s),function(t){for(var n=[],o=0;o<s.length;o++){var a=s[o],c=i[a.id];c.refs--,n.push(c)}t?(s=r(e,t),g(s)):s=[];for(o=0;o<n.length;o++){c=n[o];if(0===c.refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete i[c.id]}}}}function g(e){for(var t=0;t<e.length;t++){var n=e[t],r=i[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(m(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var s=[];for(o=0;o<n.parts.length;o++)s.push(m(n.parts[o]));i[n.id]={id:n.id,refs:1,parts:s}}}}function v(){var e=document.createElement("style");return e.type="text/css",s.appendChild(e),e}function m(e){var t,n,r=document.querySelector("style["+l+'~="'+e.id+'"]');if(r){if(u)return f;r.parentNode.removeChild(r)}if(p){var o=c++;r=a||(a=v()),t=b.bind(null,r,o,!1),n=b.bind(null,r,o,!0)}else r=v(),t=_.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}var y=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function b(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=y(t,o);else{var i=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function _(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute("media",r),d.ssrId&&e.setAttribute(l,t.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{while(e.firstChild)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},"5e51":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".highlight-content .highlight{color:red}",""]),e.exports=t},8875:function(e,t,n){var r,o,i;(function(n,s){o=[],r=s,i="function"===typeof r?r.apply(t,o):r,void 0===i||(e.exports=i)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,o,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,s=/@([^@]*):(\d+):(\d+)\s*$/gi,a=i.exec(p.stack)||s.exec(p.stack),c=a&&a[1]||!1,u=a&&a[2]||!1,f=document.location.href.replace(document.location.hash,""),d=document.getElementsByTagName("script");c===f&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(u-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(r,"$1").trim());for(var l=0;l<d.length;l++){if("interactive"===d[l].readyState)return d[l];if(d[l].src===c)return d[l];if(c===f&&d[l].innerHTML&&d[l].innerHTML.trim()===o)return d[l]}return null}}return e}))},a4bd:function(e,t,n){"use strict";n("d9aa")},d9aa:function(e,t,n){var r=n("5e51");"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var o=n("499e").default;o("7f217893",r,!0,{sourceMap:!1,shadowMode:!1})},fb15:function(e,t,n){"use strict";if(n.r(t),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(e.tag,{tag:"component",staticClass:"highlight-content"},[e._l(e.operateMessage,(function(t){return[e._v(e._s(t.message)),n("span",{staticClass:"highlight"},[e._v(e._s(t.word))])]}))],2)},a=[],c={name:"highlight",props:{search:{type:Array,default(){return[]}},message:{type:String,default:""},tag:{type:String,default:"div"}},computed:{operateMessage(){let e=[{word:"",message:this.message}];return this.search.forEach(t=>{const n=[];e.forEach(({word:e,message:r})=>{const o=this.splitMessage(r,t);o.length>0?(n.push(...o),n.push({word:e,message:""})):n.push({word:e,message:r})}),e=n}),e.filter(({word:e,message:t})=>""!==e||""!==t)}},methods:{splitMessage(e,t){const n=[],r=e.split(t);r.forEach(e=>{n.push({message:e,word:t})});const o=n.length;return o>0&&(n[o-1].word=""),n}}},u=c;n("a4bd");function f(e,t,n,r,o,i,s,a){var c,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),s?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=c):o&&(c=a?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(u.functional){u._injectStyles=c;var f=u.render;u.render=function(e,t){return c.call(t),f(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:u}}var d=f(u,s,a,!1,null,null,null),l=d.exports;t["default"]=l}})["default"]}));
//# sourceMappingURL=v-highlight-component.umd.min.js.map
{
"name": "v-highlight-component",
"version": "0.1.3",
"version": "0.1.4",
"private": false,

@@ -16,4 +16,8 @@ "author": "MOONCOM",

"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"vue-template-compiler": "^2.6.11",
"core-js": "^3.6.5",
"vue": "^2.6.11"
}
}

@@ -1,19 +0,62 @@

# vue-highlight-component
# v-highlight-component
## Project setup
### 功能介绍
> 实现了一个句子根据查询字词进行高亮显示的功能,查询的字词的输入格式为数组(为了
> 兼容分词查询功能),根据字词数组的内容进行多个词的高亮展示。使用模板差值 {{ }} 和
> v-text的形式进行高亮字词的展示,防止脚本注入的风险
### 下载插件
```
npm install
npm install v-highlight-component
```
### Compiles and hot-reloads for development
### 参数
#### search
* 类型:Array 数组
* 默认值: [ ] 空数组
* 作用:要进行查询的字词数组
* 备注:当不进行字词查询时可以不传或者设为空数组
#### message
* 类型:String 字符串
* 默认值: ' ' 空字符串
* 作用:要进行高亮查询匹配的内容
#### tag
* 类型:String 字符串
* 默认值: 'div' div标签
* 作用:查询内容的包裹标签,默认使用div标签包裹,可根据实际需求使用span
或者p标签进行包裹
### 使用
下载成功后在main.js中插入如下代码
```
npm run serve
// 引入组件
import highlight from 'v-highlight-component';
// 注册为全局组件
Vue.component('v-highlight-component',highlight);
```
### Compiles and minifies for production
在需要查询字词高亮展示的页面组件中使用
```
npm run build
<template>
...
<v-highlight-component :message='message' :search='search'/>
...
</template>
<script>
export default{
data(){
return{
message:'这是一个句子,要进行高亮匹配',
search: ['句子','高亮'],
};
},
};
</script>
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
### 在线演示
后续开放
### 兼容性
> 这是基于vue2开发的功能组件,因为没有使用vue2高版本的特性,所以理论上兼容所有的
> vue2版本

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc