Javascript Nuxtjs登录页没有';I don’我不能装,但其余的工作正常
我用Nuxtjs开发了一个博客,在开发模式下一切正常,但在我将应用程序部署到我的cpanel服务器后,登录页面(index.vue)(我的意思是)显示,几秒钟后页面加载但不正常,引导和所有刷子都没有加载,我不能使用任何东西,但是如果我导航到所有正常工作,引导程序已加载,所有的刷子工作正常 我的意思是: ->只在几秒钟后加载,不加载插件。 ->完美地工作 标题更改为“未能在“元素”上执行“setAttribute”:“-left”不是有效的属性名称。”并且我在中有以下错误(已编辑:adblock错误不再是apeard,新控制台错误:) 我找了很多,但没有找到任何解决办法 我已经做了: 我创建了一个home.vue文件,粘贴了index.vue文件中的所有代码,当我转到时,一切都在加载并正常工作,因此问题不在于index.vue中的代码,我还尝试删除页面中的任何脚本或样式,也不在于此,即使index.vue只有一个标记,问题也会出现 我还尝试通过以下方式重定向从/到/回家:Javascript Nuxtjs登录页没有';I don’我不能装,但其余的工作正常,javascript,vue.js,routes,nuxt.js,nuxtjs,Javascript,Vue.js,Routes,Nuxt.js,Nuxtjs,我用Nuxtjs开发了一个博客,在开发模式下一切正常,但在我将应用程序部署到我的cpanel服务器后,登录页面(index.vue)(我的意思是)显示,几秒钟后页面加载但不正常,引导和所有刷子都没有加载,我不能使用任何东西,但是如果我导航到所有正常工作,引导程序已加载,所有的刷子工作正常 我的意思是: ->只在几秒钟后加载,不加载插件。 ->完美地工作 标题更改为“未能在“元素”上执行“setAttribute”:“-left”不是有效的属性名称。”并且我在中有以下错误(已编辑:adblock错
export default {
created() {
this.$router.push('/home')
},
}
但是页面重定向需要时间,并且在转到/home目录之前仍然会出现错误
我还试图更改路线中的登录页,但我们没有成功
有人能帮我解决问题吗?我在网上找不到任何解决方案
my nuxt.config:
import Vue2Filters from 'vue2-filters'
export default {
mixins: [Vue2Filters.mixin],
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
title: 'Ana Rita Soares',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ hid: 'robots', name: 'robots', content: 'noindex, nofollow' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'
},
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css?family=Roboto&display=swap'
},
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Playfair+Display&display=swap'
},
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Ubuntu'
}
]
},
pageTransition: {
name: 'page',
mode: 'out-in'
},
// Global CSS (https://go.nuxtjs.dev/config-css)
css: [
],
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: [
{ src: '@/plugins/VueAwesomeSwiper.js', mode: 'client' },
{ src: '~/plugins/vue-gallery.client.js'},
{ src: '~plugins/vue-lazy-youtube-video.js'},
{ src: '~/plugins/vue2-filters'}
],
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
'@nuxtjs/fontawesome',
],
fontawesome: {
icons: {
solid: true,
brands: true
}
},
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
'@nuxt/http',
'bootstrap-vue/nuxt',
'@nuxtjs/google-gtag',
'@nuxtjs/google-analytics',
],
'google-gtag': {
id: 'GTM-TT3XJF5',
config: {
anonymize_ip: true, // anonymize IP
send_page_view: false, // might be necessary to avoid duplicated page track on page reload
linker: {
domains: ['domain.com','domain.org']
}
},
debug: true, // enable to track in dev mode
disableAutoPageTrack: true, // disable if you don't want to track each page route with router.afterEach(...).
},
googleAnalytics: {
id: 'UA-45807418-1'
},
http: {
// proxyHeaders: false
baseURL: 'https://anaritasoares.herokuapp.com/'
},
// Axios module configuration (https://go.nuxtjs.dev/config-axios)
axios: {},
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
// para ocupar menos de 500k e evitar o erro a dar build
babel: {
compact: true
}
}
}
mypackage.json
{
"name": "arsv2",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt --hostname mbsample.com --port 49000",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"deploy": "pm2 start npm --name arsv2 -- start",
"stop": "pm2 stop npm --name arsv2 -- stop"
},
"dependencies": {
"@fortawesome/free-brands-svg-icons": "^5.15.1",
"@fortawesome/free-solid-svg-icons": "^5.15.1",
"@nuxt/http": "^0.6.1",
"@nuxtjs/axios": "^5.12.2",
"@nuxtjs/fontawesome": "^1.1.2",
"@nuxtjs/google-gtag": "^1.0.4",
"@nuxtjs/gtm": "^2.4.0",
"bootstrap-vue": "^2.21.2",
"core-js": "^3.6.5",
"nuxt": "^2.14.6",
"nuxt-ssr-screen-size": "^1.0.0",
"pm2": "^4.5.5",
"swiper": "^5.4.5",
"vue": "^2.6.12",
"vue-awesome-swiper": "^4.1.1",
"vue-gallery": "^2.0.1",
"vue-lazy-youtube-video": "^2.3.0",
"vue-showdown": "^2.4.1",
"vue2-filters": "^0.12.0"
},
"devDependencies": {
"@nuxt/image": "0.0.4",
"@nuxtjs/google-analytics": "^2.4.0",
"node
-sass": "^5.0.0",
"sass-loader": "^10.1.1" }, "config": {
"nuxt": {
"host": "0.0.0.0",
"port": "49000"
} } }
问题解决了
My.htaccess文件出错,如果您有相同的问题,请使用My.htaccess配置:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^index.php(.*) http://%{HTTP_HOST}:49000/$1 [P,L]
RewriteRule (.*) http://%{HTTP_HOST}:49000/$1 [P,L]
首先禁用你的ADblock。嗨@kissu谢谢你的回复,我已经禁用了ADblock,问题仍然存在。错误是一样的吗?如果没有,请用新问题编辑您的问题。编辑后,非常感谢您的帮助