【问题标题】:For creating a Vue Native App, do you need App.js?创建 Vue Native App 需要 App.js 吗?
【发布时间】:2019-07-10 22:01:10
【问题描述】:

这里已经解决了两次,但更多的是关于如何解决它的问题。我知道如何...您可以删除 App.js。但我的问题是,App.js 是否会在打包分发后或在任何其他时间需要。如果是这样,我宁愿找到其他解决方案,而不仅仅是删除文件。

我将在 App.js 中提供代码。这是从 vue-native init 或 expo init 创建的基本文件。

看了之前的帖子: Vue native is always executing App.js instead of .vue App.vue is not working in Vue-Native application

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

export default function App() {
  return (
    <View style={styles.container}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

【问题讨论】:

  • 我发现如果要在浏览器中查看,需要App.js。

标签: expo vue-native


【解决方案1】:

如果你使用 webpack,你可以通过设置入口点来解决这个问题:

module.exports = {
...
entry: 'YourNewEntryPoint'
...
}

如果没有 Webpack,我不确定是否有办法绕过 App.js 作为入口点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-05-17
    • 2021-07-01
    • 1970-01-01
    • 2019-02-10
    • 2019-10-12
    • 2016-10-17
    • 1970-01-01
    • 2020-07-12
    相关资源
    最近更新 更多