如何解决 noscript - 在为 Vue 应用程序提供服务时未启用 JavaScript 无法正常工作 [英] How to solve noscript - doesn't work properly without JavaScript enabled when serving a Vue App

查看:66
本文介绍了如何解决 noscript - 在为 Vue 应用程序提供服务时未启用 JavaScript 无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Vue UI 界面设置一个新的 Vue.JS 应用程序.当我使用 vue serve src/App.vue 启动应用程序时,应用程序会启动,但它只在页面中显示默认的 Home |关于.当我检查 HTML 中的页面时,我看到:

I'm setting up a new Vue.JS application using the Vue UI interface. When I start the application using vue serve src/App.vue the application starts but it only displays in the page the default Home | About. When I inspect the page in the HTML I see:

<noscript>
      <strong>We're sorry but basicapp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>

在控制台中我看到

[Vue warn]: Unknown custom element: <router-link> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <App> at src/App.vue
       <Root>

我正在使用运行 Vue UI 时创建的基本应用程序

I am working with the basic application created when running the Vue UI

我正在使用运行 Vue UI 时创建的基本应用程序如果我使用 vue ui 命令运行应用程序,然后从 Vue UI 启动应用程序,它会工作.

I am working with the basic application created when running the Vue UI If I run the application using the vue ui command followed by starting the application from the Vue UI it works.

我想使用命令行打开应用程序的原因是,在 Cloud9 中我想测试应用程序,vue ui 在 localhost 上启动,但我找不到打开它的方法.我对应用程序文件所做的唯一更改只是为了让应用程序在 Cloud9 容器内运行:更改了 package.json 添加:

The reason I want to open the application using the command line is that in Cloud9 where I want to test the application the vue ui starts on localhost and I cannot find a way to open it. The only changes I made to the application files were done only to make the application run inside the Cloud9 container: changed the package.jsonadded:

"dev": "webpack-dev-server --inline --progress --port 8080 --host 0.0.0.0 --config vue.config.js --public $C9_HOSTNAME",

创建了 vue.config.js 并添加:

module.exports = {
  devServer: {
    compress: true,
    disableHostCheck: true,
  },
}

推荐答案

您需要禁用广告拦截器或在隐身模式下运行

You need to disable the adblocker or run on incognito mode

这篇关于如何解决 noscript - 在为 Vue 应用程序提供服务时未启用 JavaScript 无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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