首页| 论坛| 消息
主题:uni-app
回帖:methods: {
textTranslate: function (text, to) {
let vm = this
$.ajax({
url: 'http://openapi.youdao.com/api',
type: 'post',
dataType: 'jsonp',
data: {
q: text,
appKey: this.appKey,
salt: this.salt,
from: this.from,
to: to,
sign: md5(this.appKey + text + this.salt + this.key)
},
success: function (data) {
vm.$set(vm.$data, 'translatedText', data.translation[0])
}
})
}
}
下一楼›:success: (data) => {
this.$set(this.$data, 'translatedText', data.translation ..
‹上一楼:一段文字

查看全部回帖(4)
«返回主帖