14 changed files with 264 additions and 325 deletions
@ -1,58 +0,0 @@ |
|||
<script> |
|||
import Emitter from 'element-ui/src/mixins/emitter' |
|||
|
|||
export default { |
|||
name: 'ImageSelect1', |
|||
|
|||
componentName: 'ImageSelect1', |
|||
|
|||
mixins: [Emitter], |
|||
|
|||
inject: { |
|||
elFormItem: { |
|||
default: '' |
|||
} |
|||
}, |
|||
|
|||
props: { |
|||
value: {}, |
|||
options: Array, |
|||
disabled: Boolean, |
|||
min: Number, |
|||
max: Number, |
|||
size: String, |
|||
fill: String, |
|||
textColor: String |
|||
}, |
|||
|
|||
computed: { |
|||
_elFormItemSize() { |
|||
return (this.elFormItem || {}).elFormItemSize |
|||
}, |
|||
checkboxGroupSize() { |
|||
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size |
|||
} |
|||
}, |
|||
|
|||
watch: { |
|||
value(value) { |
|||
this.dispatch('ElFormItem', 'el.form.change', [value]) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div class="el-checkbox-group" role="group" aria-label="checkbox-group"> |
|||
<div v-for="option in options" :key="option.value" class="img-radio-item"> |
|||
<el-image |
|||
class="image" |
|||
:src="option.image" |
|||
fit="scale-down" |
|||
:preview-src-list="[option.image]" |
|||
/> |
|||
<el-radio :label="option.value">{{ option.label }}</el-radio> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
@ -1,10 +1,8 @@ |
|||
const ImageSelect = require('./ImageSelect/index').default |
|||
const ImageSelect1 = require('./ImageSelect1/index').default |
|||
const DescText = require('./DescText/index').default |
|||
export default { |
|||
install: Vue => { |
|||
Vue.component(ImageSelect.name, ImageSelect) |
|||
Vue.component(ImageSelect1.name, ImageSelect1) |
|||
Vue.component(DescText.name, DescText) |
|||
} |
|||
} |
|||
|
@ -0,0 +1,13 @@ |
|||
export default { |
|||
options(h, conf, key) { |
|||
const list = [] |
|||
let style = 'height: 100%;' |
|||
conf.__slot__.options.forEach(item => { |
|||
list.push(<el-carousel-item style={'text-align: center;'}> |
|||
<span>{item.label}</span> |
|||
<el-image fit="contain" style={style} src={item.image}></el-image> |
|||
</el-carousel-item>) |
|||
}) |
|||
return list |
|||
} |
|||
} |
Loading…
Reference in new issue