科尔多瓦android vue avd资源公共图像

时间:2020-04-03 11:56:22

标签: android cordova vue.js resources avd

我遵循了本教程并编写了自己的android cordova应用程序:

https://www.npmjs.com/package/vue-cli-plugin-cordova

我将我的应用程序的图像添加到了公共文件夹中。我的整个文件夹 看起来像这样:

my-app2:
|-.git
|-node_modules
|-public --> there are my images in the img folder, the index.css in the css folder and the index.html as main entry point
|-src --> there is my Sourcecode folder which works fine
|-src-cordova --> In this folder are the settings for my app (config.xml)
|-tests
|-.gitignore
|-babel.config
|-cypress
|-my-release-key.keystore
|-package
|-package-lock
|-README.md
|-vue.config
|-yarn.lock

公用文件夹包含所有图像和主入口 我的应用程序:index.html-文件

我使用以下相对路径引用了这些图像文件:

img/weiss.png

现在我运行以下命令,一切都会按需进行。

npm run cordova-serve-browser

然后我用cordova为Android构建了它:

npm run cordova-build-android

然后我将其安装在我的avd上,但未获得这些图像 显示。 (您必须安装jdk 1.8,gradle,android studio,android sdk ...)

我的问题是,现在如何参考这些图像 在cordova的配置中必须设置什么?

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。

这与路由器配置有关。您不必使用模式历史记录。始终使用该模式

hash

这是我的路由器:

'use strict'
import Vue from 'vue'
import VueRouter from 'vue-router'