【问题标题】:cordova android vue avd resource public image科尔多瓦 android vue avd 资源公共图像
【发布时间】:2020-07-15 14:13:25
【问题描述】:

我按照本教程编写了自己的 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 for android构建了它:

npm run cordova-build-android

然后我将它安装在我的 avd 上并没有得到这些图像 显示。 (你必须安装jdk 1.8, gradle, android studio, android sdk ...)

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

【问题讨论】:

    标签: android cordova vue.js resources avd


    【解决方案1】:

    我解决了这个问题。

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

    hash
    

    这是我的路由器:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-10
      • 2016-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-14
      • 1970-01-01
      • 2018-08-21
      相关资源
      最近更新 更多