【发布时间】:2021-01-12 21:35:30
【问题描述】:
几乎没有这方面的信息。我正在尝试使用 react-native 中的 Linking 组件,但是关于使用 react-native 组件的信息很少,我不确定我是否正确使用它...
这是我在模板中的内容:
<nb-button :on-press="loadInBrowser">
<nb-text class="source"> Test hyperlink </nb-text>
</nb-button>
这里是脚本:
import Linking from "react-native";
export default {
components: {
Linking
},
//data(),
methods: {
loadInBrowser: function () {
Linking.openURL("https://www.google.com");
},
},
}
但不起作用,我收到此错误:
"TypeError: _reactNative.default.openURL is not a function. (In '_reactNative.default.openURL("https://www.google.com")', '_reactNative.default.openURL' is undefined)
【问题讨论】:
标签: reactjs react-native vue.js url native