dvant
Version:
A Vue.js 2.0 Mobile UI at dawnwin modified from Youzan
29 lines (25 loc) • 535 B
JavaScript
;
exports.__esModule = true;
/**
* add Vue-Router support
*/
exports.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;
}
}
}
};