【发布时间】:2019-12-30 23:05:05
【问题描述】:
我是应用程序开发的新手,我想从 vue native 开始,正如我在文档中看到的那样,vue native 无法访问某些设备 API,如本地文件,但 react native 可以,而 vue 只是包装器反应原生, 那么如何在 vue 项目中使用 import react native 组件和 API 呢? 并使用expo进行开发
【问题讨论】:
标签: android ios react-native vue-native
我是应用程序开发的新手,我想从 vue native 开始,正如我在文档中看到的那样,vue native 无法访问某些设备 API,如本地文件,但 react native 可以,而 vue 只是包装器反应原生, 那么如何在 vue 项目中使用 import react native 组件和 API 呢? 并使用expo进行开发
【问题讨论】:
标签: android ios react-native vue-native
例如离子:
在脚本部分:
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-Speech 的另一个例子:
安装包:
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>
祝你好运!
【讨论】: