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.
34 lines
762 B
34 lines
762 B
4 years ago
|
import WxData from './wxData'
|
||
|
|
||
|
class Config extends WxData {
|
||
|
constructor(component) {
|
||
|
super(component)
|
||
|
this.Component = component
|
||
|
}
|
||
|
getCalendarConfig() {
|
||
|
if (!this.Component || !this.Component.config) return {}
|
||
|
return this.Component.config
|
||
|
}
|
||
|
setCalendarConfig(config) {
|
||
|
return new Promise((resolve, reject) => {
|
||
|
if (!this.Component || !this.Component.config) {
|
||
|
reject('异常:未找到组件配置信息')
|
||
|
return
|
||
|
}
|
||
|
let conf = { ...this.Component.config, ...config }
|
||
|
|
||
|
this.Component.config = conf
|
||
|
this.setData(
|
||
|
{
|
||
|
calendarConfig: conf
|
||
|
},
|
||
|
() => {
|
||
|
resolve(conf)
|
||
|
}
|
||
|
)
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default component => new Config(component)
|