beforeEnter(to, from, next) {
if (to.params.type)
return next();
const type = (isCity && 'city') || (isProduct && 'procuct');
if (!type)
return next('/404');
const {name, query, params} = to;
return next({
name,
params: {...params, type},
query
});
}
const child = parent.extend({
url: '...'
});
mounted() {
getData(this.$options.url);
}
interface Params {};
interface Response {};
namespace ITMDB {
export type params = Params;
export type response = Response;
}
mounted() {
if(this.getData)
this.getData();
}
methods: {
getData() {};
}
mounted() {
getData(this.url, this.params);
}
data() {
return {
url: '...',
params: {}
};
}
enumerable: false
. Но уже не для всех случаев.Object.getOwnPropertySymbols()
. Object.defineProperty(Function.prototype, 'bind13', {
value(thisArg, ...args) {
if(thisArg === null || thisArg === undefined)
return (...args2) => this(...args, ...args2);
if(typeof thisArg !== 'object')
thisArg = Object.assign(thisArg);
const key = Symbol('0_o');
return (...args2) => {
thisArg[key] = this;
const result = thisArg[key](...args, ...args2);
delete thisArg[key];
return result;
};
}
});