科尔多瓦android vue avd资源公共图像 [英] cordova android vue avd resource public image

查看:78
本文介绍了科尔多瓦android vue avd资源公共图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I followed this tutorial and coded my own android cordova app:

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

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

I added the images for my app to the public folder. My whole folder looks like this:

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-文件

The public folder contains all images and the main entry point of my app: the index.html-File

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

I referenced to these image files with this relative path:

img/weiss.png

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

Now I run the following command and everything works as desired.

npm run cordova-serve-browser

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

And after that I built it with cordova for android:

npm run cordova-build-android

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

Then I installed it on my avd and doesn't get these images displayed. (You have to install jdk 1.8, gradle, android studio, android sdk ...)

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

My question is now, how can I reference to these images and what do I have to set in my configuration of cordova?

推荐答案

我解决了这个问题.

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

It was about the router configuration. You don't have to use the mode history. Always use the mode

hash

这是我的路由器:

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

这篇关于科尔多瓦android vue avd资源公共图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆