Commit 829bd531 authored by yyh's avatar yyh

updateBanners

parent 9f03425e
......@@ -89,17 +89,23 @@ export default class AddBanner extends Vue {
private del(index: number) {
this.imgs.splice(index, 1);
const value = [...this.hashs];
this.emitBanners(value);
// this.emitBanners(value);
this.updateBanners(value);
}
private getFile(file: any) {
this.$api.file.upload(file).then((res: any) => {
this.imgs.push(res);
this.emitBanners(this.hashs);
this.updateBanners(this.hashs);
// this.emitBanners(this.hashs);
});
}
private emitBanners(hashs: any[]) {
const temp = hashs.map((item: any) => ({ hash: item, target: '' }));
this.$emit('update:banners', temp);
// private emitBanners(hashs: any[]) {
// const temp = hashs.map((item: any) => ({ hash: item, target: '' }));
// this.$emit('update:banners', temp);
// }
@Emit('update:banners')
private updateBanners(hashs: any[]) {
return hashs.map((item: any) => ({ hash: item, target: '' }));
}
private change(e: any) {
if (this.imgs.length >= 4) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment