UNPKG

drip-ui

Version:

Lightweight Mobile UI Components built on Vue

24 lines (23 loc) 488 B
/** * add Vue-Router support */ export default { props: { url: String, replace: Boolean, to: [String, Object] }, methods: { routerLink: function routerLink() { var to = this.to, url = this.url, $router = this.$router, replace = this.replace; if (to && $router) { $router[replace ? 'replace' : 'push'](to); } else if (url) { replace ? location.replace(url) : location.href = url; } } } };