added ESlint 语法检测
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
<el-drawer title="媒体库" :visible.sync="drawer">
|
||||
<div class="media">
|
||||
<el-image
|
||||
class="header-img-box-list"
|
||||
:src="(item.url && item.url.slice(0, 4) !== 'http')?path+item.url:item.url"
|
||||
v-for="(item,key) in picList"
|
||||
:key="key"
|
||||
class="header-img-box-list"
|
||||
:src="(item.url && item.url.slice(0, 4) !== 'http')?path+item.url:item.url"
|
||||
@click.native="chooseImg(item.url,target,targetKey)"
|
||||
>
|
||||
<div slot="error" class="header-img-box-list">
|
||||
<i class="el-icon-picture-outline"></i>
|
||||
<i class="el-icon-picture-outline" />
|
||||
</div>
|
||||
</el-image>
|
||||
</div>
|
||||
@@ -18,34 +18,40 @@
|
||||
|
||||
<script>
|
||||
const path = process.env.VUE_APP_BASE_API
|
||||
import { getFileList } from "@/api/fileUploadAndDownload";
|
||||
import { getFileList } from '@/api/fileUploadAndDownload'
|
||||
export default {
|
||||
props: {
|
||||
target: [Object],
|
||||
targetKey: [String]
|
||||
target: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
targetKey: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
drawer: false,
|
||||
picList: [],
|
||||
path:path
|
||||
};
|
||||
path: path
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
chooseImg(url, target, targetKey) {
|
||||
if(target&&targetKey){
|
||||
target[targetKey] = url;
|
||||
if (target && targetKey) {
|
||||
target[targetKey] = url
|
||||
}
|
||||
this.$emit("enter-img", url);
|
||||
this.drawer = false;
|
||||
this.$emit('enter-img', url)
|
||||
this.drawer = false
|
||||
},
|
||||
async open() {
|
||||
const res = await getFileList({ page: 1, pageSize: 9999 });
|
||||
this.picList = res.data.list;
|
||||
this.drawer = true;
|
||||
const res = await getFileList({ page: 1, pageSize: 9999 })
|
||||
this.picList = res.data.list
|
||||
this.drawer = true
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -65,4 +71,4 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user