[DevOps][开发环境] vscode-中正则匹配替换

40 阅读1分钟

需求:有如下 table columns 配置

countryName: {
    sortable: true,
    value: 'countryName',
    text: 'Country',
    // 需求1:再加一个字段 label:  'Country',
    check: true,
    format: '$ 0,0[.]00',
    // 需求2:再加一个字段 formatter 函数
    // formatter(fieldValue, field) {
    //  return numeral(fieldValue).format('$ 0,0[.]00')
    // },
}

需求1

Search: text: (.*), Replace:

text: $1,
label: $1,

需求2

Search: format: (.*), Replace:

format: $1,
formatter(fieldValue, field) {
    return numeral(fieldValue).format($1)
},