druxt-breadcrumb
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -37,3 +37,3 @@ import { resolve } from 'path'; | ||
mapState({ | ||
route: function (state) { return state.druxtRouter.route.data; }, | ||
route: function (state) { return state.druxtRouter.route; }, | ||
routes: function (state) { return state.druxtRouter.routes; } | ||
@@ -49,3 +49,3 @@ })), | ||
// If there is no route, stop here. | ||
if (!this.route) { return } | ||
if (!this.route || !Object.keys(this.route).length) { return } | ||
@@ -75,11 +75,8 @@ // Home crumb. | ||
this$1.getRoute(to).then(function (ref) { | ||
var data = ref.data; | ||
var error = ref.error; | ||
this$1.getRoute(to).then(function (route) { | ||
this$1.loading--; | ||
delete this$1.items[to]; | ||
if (data.label) { | ||
this$1.items[to] = { to: to, text: data.label }; | ||
if (route.label) { | ||
this$1.items[to] = { to: to, text: route.label }; | ||
} | ||
@@ -86,0 +83,0 @@ |
@@ -1,1 +0,1 @@ | ||
var VueDrupalEntity=function(t,e,r){"use strict";var i={name:"DruxtBreadcrumb",props:{component:{type:String,default:function(){return"div"}}},created:function(){this.getItems()},data:function(){return{loading:0,items:{}}},computed:Object.assign({},{crumbs:function(){var t=this;return this.loading?[]:Object.keys(this.items).sort((function(t,e){return t.length-e.length})).map((function(e){return t.items[e]}))}},r.mapState({route:function(t){return t.druxtRouter.route.data},routes:function(t){return t.druxtRouter.routes}})),methods:Object.assign({},{getItems:function(){var t=this;if(this.items={},this.route&&(this.items["/"]={to:"/",text:"Home"},"/"!==this.$route.path)){this.items[this.$route.path]={text:this.route.label};var e=this.$route.path.split("/").filter(String);e.pop();for(var r=function(){t.loading++;var r="/"+e.join("/");t.items[r]={},t.getRoute(r).then((function(e){var i=e.data;e.error;t.loading--,delete t.items[r],i.label&&(t.items[r]={to:r,text:i.label}),t.$forceUpdate()})).catch((function(e){t.loading--,delete t.items[r]})),e.pop()};e.length>0;)r()}}},r.mapActions({getRoute:"druxtRouter/getRoute"})),watch:{$route:"getItems"},render:function(t){if(0!==this.crumbs.length)return t(this.component,{props:{items:this.crumbs}})}};return t.DruxtBreadcrumb=i,t.default=function(t){void 0===t&&(t={}),this.addPlugin({src:e.resolve(__dirname,"../nuxt/plugin.js"),fileName:"druxt-breadcrumb.js",moduleOptions:t})},t}({},path,vuex); | ||
var VueDrupalEntity=function(t,e,r){"use strict";var i={name:"DruxtBreadcrumb",props:{component:{type:String,default:function(){return"div"}}},created:function(){this.getItems()},data:function(){return{loading:0,items:{}}},computed:Object.assign({},{crumbs:function(){var t=this;return this.loading?[]:Object.keys(this.items).sort((function(t,e){return t.length-e.length})).map((function(e){return t.items[e]}))}},r.mapState({route:function(t){return t.druxtRouter.route},routes:function(t){return t.druxtRouter.routes}})),methods:Object.assign({},{getItems:function(){var t=this;if(this.items={},this.route&&Object.keys(this.route).length&&(this.items["/"]={to:"/",text:"Home"},"/"!==this.$route.path)){this.items[this.$route.path]={text:this.route.label};var e=this.$route.path.split("/").filter(String);e.pop();for(var r=function(){t.loading++;var r="/"+e.join("/");t.items[r]={},t.getRoute(r).then((function(e){t.loading--,delete t.items[r],e.label&&(t.items[r]={to:r,text:e.label}),t.$forceUpdate()})).catch((function(e){t.loading--,delete t.items[r]})),e.pop()};e.length>0;)r()}}},r.mapActions({getRoute:"druxtRouter/getRoute"})),watch:{$route:"getItems"},render:function(t){if(0!==this.crumbs.length)return t(this.component,{props:{items:this.crumbs}})}};return t.DruxtBreadcrumb=i,t.default=function(t){void 0===t&&(t={}),this.addPlugin({src:e.resolve(__dirname,"../nuxt/plugin.js"),fileName:"druxt-breadcrumb.js",moduleOptions:t})},t}({},path,vuex); |
@@ -34,3 +34,3 @@ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var path=require('path'),vuex=require('vuex');var component = { | ||
vuex.mapState({ | ||
route: function (state) { return state.druxtRouter.route.data; }, | ||
route: function (state) { return state.druxtRouter.route; }, | ||
routes: function (state) { return state.druxtRouter.routes; } | ||
@@ -46,3 +46,3 @@ })), | ||
// If there is no route, stop here. | ||
if (!this.route) { return } | ||
if (!this.route || !Object.keys(this.route).length) { return } | ||
@@ -72,11 +72,8 @@ // Home crumb. | ||
this$1.getRoute(to).then(function (ref) { | ||
var data = ref.data; | ||
var error = ref.error; | ||
this$1.getRoute(to).then(function (route) { | ||
this$1.loading--; | ||
delete this$1.items[to]; | ||
if (data.label) { | ||
this$1.items[to] = { to: to, text: data.label }; | ||
if (route.label) { | ||
this$1.items[to] = { to: to, text: route.label }; | ||
} | ||
@@ -83,0 +80,0 @@ |
{ | ||
"name": "druxt-breadcrumb", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "Provides a Breadcrumb Vue component to be used within a Druxt (DRUpal nuXT) project.", | ||
@@ -49,3 +49,3 @@ "repository": { | ||
"peerDependencies": { | ||
"druxt-router": "^0.8.0" | ||
"druxt-router": "^0.11.0" | ||
}, | ||
@@ -52,0 +52,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10645
200