vue的props传递的变量的type有时候正常情况应该是单一类型,如下
1 | articleId: { |
2 | type: String, |
3 | required: true |
4 | } |
如果必须是多个类型,则如下:
1 | articleId: { |
2 | type: [Number, String, Object], |
3 | required: true |
4 | } |
但是不建议这么做,类型应该始终如一。
vue的props传递的变量的type有时候正常情况应该是单一类型,如下
1 | articleId: { |
2 | type: String, |
3 | required: true |
4 | } |
如果必须是多个类型,则如下:
1 | articleId: { |
2 | type: [Number, String, Object], |
3 | required: true |
4 | } |
但是不建议这么做,类型应该始终如一。