data() {
return {
reg: /([1-9]\d{0,14}\.\d{0,2})|(0\.\d{0,2})|([1-9]\d{0,14})|(0\.?)/,
money: 0,
oldValue: 0,
moneyStr: "",
}
},
props: {
jsonData: {
required: true,
},
keyName: {
required: false,
default: "value"
},
roundNumberLength: {
required: false,
type: Number,
default: 14
}
},
想在 created中把两个14换成roundNumberLength这个父组件传过来的变量,字符串应该怎么拼接。麻烦给举个例子。谢谢。new RegExp(),可以。别的方式也可以。谢谢