Coder Social home page Coder Social logo

博主我有一个疑问 about vue-wechat HOT 13 OPEN

zhaohaodang avatar zhaohaodang commented on August 25, 2024
博主我有一个疑问

from vue-wechat.

Comments (13)

zhaohaodang avatar zhaohaodang commented on August 25, 2024

因为使用的是路由懒加载,js是被脚本分割成一块一块按需加载,底部、搜索框和头部都是App.vue注册的组件,会在页面打开时正确载入三部分js,而其他组件生成的js因为你修改路径的原因,没能正确加载出来。建议你不要修改路径,也不要手动打开/dist/index.html,应该在/dist下开启http服务 http-server 当然 你需要先安装这个插件,npm install http-server -g

from vue-wechat.

sfsoul avatar sfsoul commented on August 25, 2024

我明白前面话的意思,但是我不懂

from vue-wechat.

sfsoul avatar sfsoul commented on August 25, 2024

大牛,我明白之前话的意思,也按照你的意思install 了http-server,但请问下下面的步骤是什么吗?
就是在/dis下开启http服务这应该需要如何操作呢?小白第一次尝试麻烦了。

from vue-wechat.

zhaohaodang avatar zhaohaodang commented on August 25, 2024

在 /dist 目录下运行命令 http-server 会有类似下面的提示

Starting up http-server, serving ./
Available on:
  http://172.18.30.95:8080
  http://127.0.0.1:8080

然后你在浏览器中访问它输出给你的 http 地址 就像上面的

from vue-wechat.

sfsoul avatar sfsoul commented on August 25, 2024

谢谢大牛!我跑起来了!!!

from vue-wechat.

kawaiyiyuk avatar kawaiyiyuk commented on August 25, 2024

大神有时间能把Build打包后上线流程写一下么,我也遇到那个朋友相同的问题,上传到服务器后,不改index路径的话,会有路径问题,改了路径又有 Error: Loading chunk 3 failed. 这个问题,小白实在是不知道从何入手去修改了

from vue-wechat.

zhaohaodang avatar zhaohaodang commented on August 25, 2024

你需要了解webpack的output.publicPath解决路径问题,修改config/index.js里的build对象

from vue-wechat.

kawaiyiyuk avatar kawaiyiyuk commented on August 25, 2024

感谢指导,成功的解决了问题 需要将 assetsPublicPath: '/' 改成assetsPublicPath: './' 再次感谢

from vue-wechat.

pandaLCW avatar pandaLCW commented on August 25, 2024

我在我的webpack.base.conf里面加了{
test: /.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},这段 可是还是报Uncaught SyntaxError: Unexpected token import 请问一下什么意思

from vue-wechat.

githublxx avatar githublxx commented on August 25, 2024

chalk装上 项目也跑不起来
vue-WeChat-master>npm run dev

[email protected] dev D:\Front\vue-WeChat-master
node build/dev-server.js

module.js:550
throw err;
^

Error: Cannot find module 'chalk'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (D:\Front\vue-WeChat-master\build\check-versions.js:1:75)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: node build/dev-server.js
npm ERR! Exit status 1

from vue-wechat.

zhaohaodang avatar zhaohaodang commented on August 25, 2024

from vue-wechat.

zhe-he avatar zhe-he commented on August 25, 2024

@githublxx 这个bug 是window 独有的,
当你安装chalk后又会提示你缺另一个。
出现问题的原因是: 你下载node 模块时中断过(模块的下载机制是先下载配置文件后下载详细内容,模块的判断机制是读取是否有配置文件,这里的bug)
简单的解决方法是 删除你本地的node_modules 然后重新执行 一遍(c)npm install 就可以了。

from vue-wechat.

wangjiudeng avatar wangjiudeng commented on August 25, 2024

大牛,在浏览器中没有办法发送消息,是只能在手机上发送,电脑上没办法发送嘛,还是没有做发送的功能啊

from vue-wechat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.