vue-cookieconsent-component
Version:
1 lines • 4.11 kB
JavaScript
webpackJsonp([1],{"3hZJ":function(t,e){},NHnr:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=o("Dd8w"),n=o.n(s),i=o("/5sW"),a={name:"CookieConsent",props:{transition:{type:String,default:"cookie-consent-transition"},message:{type:String,default:"This website uses cookies to ensure you get the best experience on our website."},linkLabel:{type:String,default:"Learn more"},buttonLabel:{type:String,default:"Got it!"},href:{type:String,default:"http://cookiesandyou.com"},target:{type:String,default:"_blank"},cookieName:{type:String,default:"cookieconsent_status"},cookiePath:{type:String,default:"/"},cookieDomain:{type:String,default:""},cookieExpiryDays:{type:Number,default:365}},data:function(){return{show:void 0}},computed:{cookie:function(){return!this.getCookie(this.cookieName)}},beforeMount:function(){this.show=this.cookie},methods:{dismiss:function(){this.show=!1,this.setCookie(this.cookieName,1,this.cookieExpiryDays,this.cookieDomain,this.cookiePath)},getCookie:function(t){var e=("; "+document.cookie).split("; "+t+"=");return 2!==e.length?void 0:e.pop().split(";").shift()},setCookie:function(t,e,o,s,n){var i=new Date;i.setDate(i.getDate()+(o||365));var a=[t+"="+e,"expires="+i.toUTCString(),"path="+(n||"/")];s&&a.push("domain="+s),document.cookie=a.join(";")}}},c={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("transition",{attrs:{name:t.transition}},[t.show?o("div",{staticClass:"cookie-consent",attrs:{role:"dialog"}},[t._t("message",[o("span",{staticClass:"cookie-consent-message"},[t._v("\n "+t._s(t.message)+"\n "),t._t("link",[o("a",t._b({staticClass:"cookie-consent-link",attrs:{role:"button"}},"a",{href:t.href,target:t.target},!1),[t._v("\n "+t._s(t.linkLabel)+"\n ")])])],2)]),t._v(" "),o("section",{on:{click:t.dismiss}},[t._t("button",[o("button",{staticClass:"cookie-consent-compliance",attrs:{type:"button"}},[t._v("\n "+t._s(t.buttonLabel)+"\n ")])])],2)],2):t._e()])},staticRenderFns:[]},r={name:"App",components:{CookieConsent:o("VU/8")(a,c,!1,null,null,null).exports}},l={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app"}},[this._m(0),this._v(" "),e("cookie-consent",{attrs:{"cookie-expiry-days":-1}})],1)},staticRenderFns:[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"my-5 container"},[o("header",{staticClass:"pb-3 clearfix border-bottom"},[o("ul",{staticClass:"nav float-right"},[o("li",{staticClass:"nav-item"},[o("a",{staticClass:"nav-link",attrs:{href:"https://github.com/EvodiaAut/vue-cookieconsent-component",target:"_blank"}},[t._v("\n Github\n ")])])]),t._v(" "),o("h1",{staticClass:"text-muted"},[t._v("vue-cookieconsent-component")]),t._v(" "),o("p",{staticClass:"lead"},[t._v("Vue Cookieconsent")]),t._v(" "),o("div",{staticClass:"d-flex flex-wrap"},[o("a",{attrs:{href:"https://www.npmjs.com/package/vue-cookieconsent-component",target:"_blank"}},[o("img",{staticClass:"m-1",attrs:{src:"https://img.shields.io/npm/v/vue-cookieconsent-component.svg?style=for-the-badge",alt:"vue-cookieconsent-component npm"}})]),t._v(" "),o("a",{attrs:{href:"https://github.com/EvodiaAut/vue-cookieconsent-component/blob/master/LICENSE.md",target:"_blank"}},[o("img",{staticClass:"m-1",attrs:{src:"https://img.shields.io/github/license/mashape/apistatus.svg?style=for-the-badge",alt:"vue-cookieconsent-component license"}})]),t._v(" "),o("a",{attrs:{href:"https://www.npmjs.com/package/vue-cookieconsent-component",target:"_blank"}},[o("img",{staticClass:"m-1",attrs:{src:"https://img.shields.io/npm/dt/vue-cookieconsent-component.svg?style=for-the-badge",alt:"vue-cookieconsent-component npm"}})])])]),t._v(" "),o("main",{staticClass:"my-5 text-center",attrs:{role:"main"}},[o("div",{staticClass:"display-4 mb-2"},[t._v("\n Look down\n ")]),t._v(" "),o("p",[t._v("To try again, reload the page")])])])}]};var p=o("VU/8")(r,l,!1,function(t){o("3hZJ")},null,null).exports;i.a.config.productionTip=!1,new i.a(n()({el:"#app"},p))}},["NHnr"]);