【问题标题】:using react-native in vue-native在 vue-native 中使用 react-native
【发布时间】: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


    【解决方案1】:

    例如离子:

    在脚本部分:

    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>
    

    祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-13
      • 2019-02-17
      • 2019-06-10
      • 1970-01-01
      • 2020-01-05
      • 2017-04-20
      相关资源
      最近更新 更多