Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (suffix && typeof suffix === 'function') {
renderer = suffix();
renderer.attach(this.ref('suffix'));
}
else if (typeof suffix === 'string') {
this.data.set('suffixString', suffix);
}
},
template: presuffix
});
export default san.defineComponent({
dataTypes: {
addonAfter: DataTypes.oneOfType([DataTypes.string, DataTypes.instanceOf(Object)]),
addonBefore: DataTypes.oneOfType([DataTypes.string, DataTypes.instanceOf(Object)]),
prefix: DataTypes.oneOfType([DataTypes.string, DataTypes.instanceOf(Object)]),
suffix: DataTypes.oneOfType([DataTypes.string, DataTypes.instanceOf(Object)]),
defaultValue: DataTypes.any,
placeholder: DataTypes.string,
disabled: DataTypes.bool,
inputType: DataTypes.oneOf(['inputGroup', 'inputFix']),
id: DataTypes.oneOfType([DataTypes.string, DataTypes.number]),
size: DataTypes.oneOf(['large', 'default', 'small']),
type: DataTypes.string,
value: DataTypes.any
},
components: {
's-base-input': BaseInput,
's-icon': Icon,
'a-addonrenderer': AddonRenderer,
'a-presuffix': PresuffixRenderer
},
);
return name;
},
template: `<span>
<span>{{getBreadcrumbName(route, params)}}</span>
<a href="{{getHref(paths)}}">{{getBreadcrumbName(route, params)}}</a>
</span>`
});
export default san.defineComponent({
components: {
's-breadcrumb-item': breadcrumbItem
},
dataTypes: {
separator: DataTypes.string,
routes: DataTypes.instanceOf(Array)
},
initData() {
return {
separator: '/',
paths: []
};
},
computed: {
injectItemRender() {
const instance = this.data.get('instance');
const itemRender = this.data.get('itemRender') || defaultItemRender;
if (instance) {
instance.components.itemrender = itemRender;
}
}
},
return san.defineComponent({
template: `
<span>
<span>{{route.breadcrumbName}}</span>
<a href="#{{route.path}}">{{route.breadcrumbName}}</a>
</span>
`
});
};
export default san.defineComponent({
dataTypes: {
href: DataTypes.string,
route: DataTypes.instanceOf(Object),
index: DataTypes.number,
params: DataTypes.instanceOf(Object)
},
attached() {
let itemRender = this.data.get('itemRender');
const {route, index, params, allLen} = this.data.get();
let renderer;
itemRender = itemRender ? itemRender : defaultItem;
if (route && itemRender) {
if (params) {
route.path = route.path || '';
let path = route.path.replace(/^\//, '');
Object.keys(params).forEach(key => {
path = path.replace(`:${key}`, params[key]);
});
route.path = path;
}
let Renderer = itemRender();
const defaultItem = function () {
return san.defineComponent({
template: `
<span>
<span>{{route.breadcrumbName}}</span>
<a href="#{{route.path}}">{{route.breadcrumbName}}</a>
</span>
`
});
};
export default san.defineComponent({
dataTypes: {
href: DataTypes.string,
route: DataTypes.instanceOf(Object),
index: DataTypes.number,
params: DataTypes.instanceOf(Object)
},
attached() {
let itemRender = this.data.get('itemRender');
const {route, index, params, allLen} = this.data.get();
let renderer;
itemRender = itemRender ? itemRender : defaultItem;
if (route && itemRender) {
if (params) {
route.path = route.path || '';
let path = route.path.replace(/^\//, '');
Object.keys(params).forEach(key => {
path = path.replace(`:${key}`, params[key]);
});
route.path = path;