榆山数据端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

61 lines
1.5 KiB

import baseComponent from '../helpers/baseComponent'
import classNames from '../helpers/classNames'
import styleToCssString from '../helpers/styleToCssString'
baseComponent({
properties: {
prefixCls: {
type: String,
value: 'wux-media',
},
thumb: {
type: String,
value: '',
},
thumbStyle: {
type: [String, Object],
value: '',
observer(newVal) {
this.setData({
extStyle: styleToCssString(newVal),
})
},
},
title: {
type: String,
value: '',
},
label: {
type: String,
value: '',
},
align: {
type: String,
value: 'center',
},
},
data: {
extStyle: '',
},
computed: {
classes: ['prefixCls, align', function(prefixCls, align) {
const wrap = classNames(prefixCls, {
[`${prefixCls}--align-${align}`]: align,
})
const hd = `${prefixCls}__hd`
const thumb = `${prefixCls}__thumb`
const bd = `${prefixCls}__bd`
const title = `${prefixCls}__title`
const desc = `${prefixCls}__desc`
return {
wrap,
hd,
thumb,
bd,
title,
desc,
}
}],
},
})