智能照明系统APP-本地串口
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.
LightingSystemApp-serial/.svn/pristine/8c/8ce633e1faace0449f107b63b64...

27 lines
709 B

3 years ago
module.exports = {
postTransformNode (el) {
const attrsMap = el.attrsMap
if (attrsMap['open-type'] !== 'getPhoneNumber') {
return
}
const getPhoneNumberValue = attrsMap['@getphonenumber'] || attrsMap['v-on:getphonenumber']
if (!getPhoneNumberValue) {
return
}
el.attrs.find(attr => attr.name === 'open-type').value = '"getAuthorize"'
el.attrs.push({
name: 'scope',
value: '"phoneNumber"'
})
delete el.events.getphonenumber
el.events.getAuthorize = {
value: '$onAliGetAuthorize(\'' + getPhoneNumberValue + '\',$event)'
}
el.events.error = {
value: '$onAliAuthError(\'' + getPhoneNumberValue + '\',$event)'
}
}
}