创建一个 Vue Native App,你需要 App.js 吗?
For creating a Vue Native App, do you need App.js?
这里已经解决了两次,但更多的是关于如何绕过它的问题。我知道如何...您可以删除 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',
},
});
如果你使用的是 webpack,你可以通过设置入口点来解决这个问题:
module.exports = {
...
entry: 'YourNewEntryPoint'
...
}
如果没有 Webpack,我不确定是否有办法绕过 App.js 作为入口点。
这里已经解决了两次,但更多的是关于如何绕过它的问题。我知道如何...您可以删除 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',
},
});
如果你使用的是 webpack,你可以通过设置入口点来解决这个问题:
module.exports = {
...
entry: 'YourNewEntryPoint'
...
}
如果没有 Webpack,我不确定是否有办法绕过 App.js 作为入口点。