我是应用程序开发的新手,我想从vue Native开始,正如我在文档中看到的,vue native不能访问某些设备API,比如本地文件,但react native可以,而vue只是React native的包装器,所以我如何使用import react native组件和API的内部vue项目?并利用expo进行开发
发布于 2019-09-12 20:33:56
以为例:
在脚本部分:
import { Ionicons } from "@expo/vector-icons";
export default {
components: {Ionicons},
}之后,您可以在模板中使用它:
<template>
<view class="container">
<ionicons name="md-checkmark-circle" size=92 color="green" />
</view>
</template>你可以在这里看到例子:https://vue-native.io/docs/community-libraries-doc.html
使用Expo-的另一个示例:
正在安装程序包:
expo install expo-speech将其添加到脚本中:
import * as Speech from 'expo-speech';
export default {
methods: {
sayHi: function(){
Speech.speak('Hi');
}
}
}在模板中:
<template>
<view class="container">
<button title="Say Hi" :on-press="sayHi" />
</view>
</template>祝好运!
https://stackoverflow.com/questions/57663274
复制相似问题