如何将Vue后端返回的数字转换并回显为对应的汉字表示?
- 内容介绍
- 文章标签
- 相关推荐
本文共计88个文字,预计阅读时间需要1分钟。
{scope.row.userStatus | formatUserStatus}filters: { formatUserStatus: { status: { if (status===0) { // 是转为Number return '正常' } else if (
{{scope.row.userStatus | formatUserStatus }} filters: { formatUserStatus (sta{{scope.row.userStatus | formatUserStatus }}
filters: { formatUserStatus (status) { if (+status === 0) { // +是转为Number return '正常' } else if (+status === 1) { return '异常' } else if (+status === 2) { return '关闭' } else { '' } } },
userStatusStatus (status) { if (+status === 0) { return 'color: green;' } else if (+status === 1) { return 'color: red;' } else if (+status === 2) { return 'color: yellow;' } else { '' } },
本文共计88个文字,预计阅读时间需要1分钟。
{scope.row.userStatus | formatUserStatus}filters: { formatUserStatus: { status: { if (status===0) { // 是转为Number return '正常' } else if (
{{scope.row.userStatus | formatUserStatus }} filters: { formatUserStatus (sta{{scope.row.userStatus | formatUserStatus }}
filters: { formatUserStatus (status) { if (+status === 0) { // +是转为Number return '正常' } else if (+status === 1) { return '异常' } else if (+status === 2) { return '关闭' } else { '' } } },
userStatusStatus (status) { if (+status === 0) { return 'color: green;' } else if (+status === 1) { return 'color: red;' } else if (+status === 2) { return 'color: yellow;' } else { '' } },

