Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ie 11
31 changes: 31 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"parserOptions": {
"parser": "babel-eslint",
"ecmaVersion": 10
},
"plugins": [
"prettier",
"dependencies",
"html",
"unicorn",
"babel",
"markdown"
],
"extends": [
"plugin:vue/recommended",
"plugin:ava/recommended",
"plugin:unicorn/recommended",
"xo",
"xo-space"
],
"rules": {
"vue/no-use-v-if-with-v-for": "off",
"no-new": "off",
"capitalized-comments": "off"
}
}
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ src
coverage
.nyc_output
npm-debug.log
*.sublime*
docs
dist
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js

node_js:
- "node"
- "lts/*"
- 10
- 8

after_success:
- npm run coverage
7 changes: 7 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const presets = [
[
'@babel/preset-env'
]
];

module.exports = {presets};
29 changes: 28 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
## <small>0.5.1 (2019-06-24)</small>

* build: add src docs ignore ([4b01ff8](https://github.com/Scrum/vue-2-breadcrumbs/commit/4b01ff8))
* build: bundle ([793cdd6](https://github.com/Scrum/vue-2-breadcrumbs/commit/793cdd6))
* build: bundle ([ec0329a](https://github.com/Scrum/vue-2-breadcrumbs/commit/ec0329a))
* build: change main file ([2152ae6](https://github.com/Scrum/vue-2-breadcrumbs/commit/2152ae6))
* build: change to new build system ([5d36e13](https://github.com/Scrum/vue-2-breadcrumbs/commit/5d36e13))
* build: enabled terser ([be9cc26](https://github.com/Scrum/vue-2-breadcrumbs/commit/be9cc26))
* build: made configs from package ([6ffae4e](https://github.com/Scrum/vue-2-breadcrumbs/commit/6ffae4e))
* build(deps): bump extend from 3.0.1 to 3.0.2 ([ad66243](https://github.com/Scrum/vue-2-breadcrumbs/commit/ad66243))
* build(deps): bump handlebars from 4.0.12 to 4.1.2 ([ba83f42](https://github.com/Scrum/vue-2-breadcrumbs/commit/ba83f42))
* build(deps): bump js-yaml from 3.9.1 to 3.13.1 ([2891c3c](https://github.com/Scrum/vue-2-breadcrumbs/commit/2891c3c))
* build(deps): bump lodash from 4.17.4 to 4.17.11 ([7133b08](https://github.com/Scrum/vue-2-breadcrumbs/commit/7133b08))
* docs: add demo page ([20ad120](https://github.com/Scrum/vue-2-breadcrumbs/commit/20ad120))
* docs: small update ([1b93d4d](https://github.com/Scrum/vue-2-breadcrumbs/commit/1b93d4d))
* docs: update breadcrumbs name ([dcefeb2](https://github.com/Scrum/vue-2-breadcrumbs/commit/dcefeb2))
* fix: error on ie 11, close #49 ([36a5638](https://github.com/Scrum/vue-2-breadcrumbs/commit/36a5638)), closes [#49](https://github.com/Scrum/vue-2-breadcrumbs/issues/49)
* fix: named routes close #55 ([cd41adc](https://github.com/Scrum/vue-2-breadcrumbs/commit/cd41adc)), closes [#55](https://github.com/Scrum/vue-2-breadcrumbs/issues/55)
* ci: drop support old node ([ddf9248](https://github.com/Scrum/vue-2-breadcrumbs/commit/ddf9248))
* refactor: small ) ([a13100f](https://github.com/Scrum/vue-2-breadcrumbs/commit/a13100f))
* perf: add dist for browser ([e48e129](https://github.com/Scrum/vue-2-breadcrumbs/commit/e48e129))
* test: add simple test, close #3 ([56ecd05](https://github.com/Scrum/vue-2-breadcrumbs/commit/56ecd05)), closes [#3](https://github.com/Scrum/vue-2-breadcrumbs/issues/3)



## 0.5.0 (2019-02-06)

* 0.5.0 ([ddd02ca](https://github.com/Scrum/vue-2-breadcrumbs/commit/ddd02ca))
* build: update changelog ([1fd3901](https://github.com/Scrum/vue-2-breadcrumbs/commit/1fd3901))
* build: update dep dev ([1ee3913](https://github.com/Scrum/vue-2-breadcrumbs/commit/1ee3913))
* docs: add example witch context ([ea60887](https://github.com/Scrum/vue-2-breadcrumbs/commit/ea60887))
* feat: add context for callback, close #53 ([c6b838e](https://github.com/Scrum/vue-2-breadcrumbs/commit/c6b838e)), closes [#53](https://github.com/Scrum/vue-2-breadcrumbs/issues/53)
* build: update dep dev ([1ee3913](https://github.com/Scrum/vue-2-breadcrumbs/commit/1ee3913))



Expand Down
1 change: 1 addition & 0 deletions dist/vue-2-breadcrumbs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

186 changes: 186 additions & 0 deletions dist/vue-breadcrumbs.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.VueBreadcrumbs = {}));
}(this, function (exports) { 'use strict';

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}

return obj;
}

function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);

if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}

ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}

return target;
}

var script = {
name: "breadcrumbs",
methods: {
getBreadcrumb: function getBreadcrumb(bc) {
return typeof bc === 'function' ? bc.call(this, this.$route.params) : bc;
}
},
template: "\n <ol\n class=\"breadcrumb\"\n v-if=\"$breadcrumbs.length\"\n >\n <li\n class=\"breadcrumb-item\"\n v-if=\"crumb.meta.breadcrumb\"\n v-for=\"(crumb, i) in $breadcrumbs\"\n :key=\"crumb\"\n >\n <router-link\n active-class=\"active\"\n :to=\"{ path: crumb.path }\"\n :tag=\"i != $breadcrumbs.length - 1 ? 'a' : 'span'\"\n >\n {{ getBreadcrumb(crumb.meta.breadcrumb) }}\n </router-link>\n </li>\n </ol>"
};

function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
/* server only */
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
if (typeof shadowMode !== 'boolean') {
createInjectorSSR = createInjector;
createInjector = shadowMode;
shadowMode = false;
} // Vue.extend constructor export interop.


var options = typeof script === 'function' ? script.options : script; // render functions

if (template && template.render) {
options.render = template.render;
options.staticRenderFns = template.staticRenderFns;
options._compiled = true; // functional template

if (isFunctionalTemplate) {
options.functional = true;
}
} // scopedId


if (scopeId) {
options._scopeId = scopeId;
}

var hook;

if (moduleIdentifier) {
// server build
hook = function hook(context) {
// 2.3 injection
context = context || // cached call
this.$vnode && this.$vnode.ssrContext || // stateful
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
// 2.2 with runInNewContext: true

if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__;
} // inject component styles


if (style) {
style.call(this, createInjectorSSR(context));
} // register component module identifier for async chunk inference


if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier);
}
}; // used by ssr in case component is cached and beforeCreate
// never gets called


options._ssrRegister = hook;
} else if (style) {
hook = shadowMode ? function () {
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
} : function (context) {
style.call(this, createInjector(context));
};
}

if (hook) {
if (options.functional) {
// register for functional component in vue file
var originalRender = options.render;

options.render = function renderWithStyleInjection(h, context) {
hook.call(context);
return originalRender(h, context);
};
} else {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate;
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}

return script;
}

var normalizeComponent_1 = normalizeComponent;

/* script */
const __vue_script__ = script;

/* template */

/* style */
const __vue_inject_styles__ = undefined;
/* scoped */
const __vue_scope_id__ = undefined;
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
const __vue_is_functional_template__ = undefined;
/* style inject */

/* style inject SSR */



var breadcrumbs = normalizeComponent_1(
{},
__vue_inject_styles__,
__vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
undefined,
undefined
);

var plugin = (function (Vue, options) {
Object.defineProperties(Vue.prototype, {
$breadcrumbs: {
get: function get() {
return this.$route.matched.map(function (route) {
return _objectSpread({}, route, {
path: route.path.length > 0 ? route.path : '/'
});
});
}
}
});
Vue.component(breadcrumbs.name, _objectSpread({}, breadcrumbs, options));
});

exports.VueBreadcrumbsPlugin = plugin;
exports.default = plugin;

Object.defineProperty(exports, '__esModule', { value: true });

}));
Loading