我需要以编程方式提交表单,但我也需要它preventDefault。
现在我有以下几点:
submit() {
this.$refs.form.submit()
}
Run Code Online (Sandbox Code Playgroud)
它工作正常,但我无法阻止提交的默认值,最终刷新页面。
我正在尝试匹配仅包含此字符类中的字符的单词: [A-z'\\/%],不包括以下情况:
<和之间>[和之间]{和之间}所以,假设我有这个有趣的字符串:
[beginning]<start>How's {the} /weather (\\today%?)[end]
Run Code Online (Sandbox Code Playgroud)
我需要匹配以下字符串:
[ "How's", "/weather", "\\today%" ]
Run Code Online (Sandbox Code Playgroud)
我试过使用这种模式:
/[A-z'/\\%]*(?![^{]*})(?![^\[]*\])(?![^<]*>)/gm
Run Code Online (Sandbox Code Playgroud)
但由于某种原因,它匹配:
[ "[beginning]", "", "How's", "", "", "", "/weather", "", "", "\\today%", "", "", "[end]", "" ]
Run Code Online (Sandbox Code Playgroud)
我不确定为什么我的模式允许[和之间的东西],因为我使用了(?![^\[]*\]),并且类似的方法似乎适用于不匹配{these cases}和<these cases>。我也不确定为什么它匹配所有空字符串。
有什么智慧吗?:)
运行的时候pod install出现了这个错误:
React Native 0.64.0 [!]
React需要 CocoaPods 版本>= 1.10.1,您当前的版本不满足该版本,1.10.0
使用: