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.
22 lines
601 B
22 lines
601 B
import {
|
|
camelize
|
|
} from 'uni-shared'
|
|
|
|
export function parseExternalClasses (externalClasses, vueComponentOptions) {
|
|
if (!externalClasses) {
|
|
return
|
|
}
|
|
if (!Array.isArray(externalClasses)) {
|
|
externalClasses = [externalClasses]
|
|
}
|
|
vueComponentOptions.mpOptions.externalClasses = externalClasses
|
|
if (!vueComponentOptions.mpOptions.properties) {
|
|
vueComponentOptions.mpOptions.properties = Object.create(null)
|
|
}
|
|
externalClasses.forEach(externalClass => {
|
|
vueComponentOptions.mpOptions.properties[camelize(externalClass)] = {
|
|
type: String,
|
|
value: ''
|
|
}
|
|
})
|
|
}
|
|
|