提交 951bd143 编写于 作者: 雪洛's avatar 雪洛

fix: connectSocket protocols accept string

上级 415c2bae
......@@ -27,8 +27,12 @@ export const connectSocket = {
}
},
protocols: {
type: Array,
// 微信文档虽然写的是数组,但是可以正常传递字符串
type: [Array, String],
validator (value, params) {
if (typeof value === 'string') {
value = [value]
}
params.protocols = (value || []).filter(str => typeof str === 'string')
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册