[关闭]
@2890594972 2019-05-03T19:00:04.000000Z 字数 1551 阅读 1235

国金投资 vue-cli3+muse-ui开发

muse-ui


apicloud打包vue项目:
https://www.cnblogs.com/undefined000/p/9559694.html

1、创建项目:
vue create guojintz-vue-webapp
启动命令:yarn serve
待了解:vue ui

2、支持less: https://www.zybuluo.com/mdeditor#931687
npm install less less-loader --save-dev

3、安装和引入muse-ui: https://muse-ui.org/#/zh-CN/usage
npm i muse-ui -S

4、安装axios数据请求
vue add axios 测试

5、需要配置代理:vue.config.js

6、这是单页面应用,所有需要vue-router支持
内置了,不需要npm i vue-router

7、安装toast支持 用于消息提示
https://github.com/museui/muse-ui-toast
image_1d9u0ggt21pqh33a149f11gav1t2q.png-6.3kB

  1. this.$toast.message('hello world');
  2. this.$toast.success('hello world');
  3. this.$toast.info('hello world');
  4. this.$toast.warning('hello world');
  5. this.$toast.error('hello world');

tips:需要引入字体图标样式:
image_1d9u00c1616oodht9n1icp1hmu9.png-52.2kB

8、安装dialog支持 用于美化系统默认的对话框
https://github.com/museui/muse-ui-message
image_1d9u07u23qisec71fq57bp1t4sm.png-20.1kB
image_1d9u0b7oee80177f1m2vp3c1qfe1j.png-18.3kB
image_1d9u0dq6m1vot1ljkqjk1tq510at20.png-22.6kB

9、安装支持muse-ui-loading 用于显示加载
https://github.com/museui/muse-ui-loading
image_1d9u0mj0k1gss1kcm13lidh5129737.png-12kB

10、muse-ui-progress用于页面加载进度
https://github.com/museui/muse-ui-progress
image_1d9u10efa9c8vhgonj6911rb63k.png-4.4kB

  1. module.exports = {
  2. // 配置 axios 代理请求
  3. devServer: {
  4. proxy: {
  5. '/api': {
  6. target: 'http://apigtz.damoxueyuan.com/index.php',
  7.                     // 在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
  8. changeOrigin: true, 
  9. ws: true,
  10. pathRewrite: {
  11. // 替换target中的请求地址,也就是说以后你在请求http://api.jisuapi.com/XXXXX这个地址的时候直接写成/api即可
  12. '^/api': '/' 
  13. }
  14. }
  15. }
  16. },
  17. }

6、这是单页面应用,所有需要vue-router支持
内置了,不需要npm i vue-router

  1. Vue CLI v3.7.0
  2. ? Please pick a preset: Manually select features
  3. ? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert selection)
  4. >(*) Babel
  5. ( ) TypeScript
  6. ( ) Progressive Web App (PWA) Support
  7. ( ) Router
  8. ( ) Vuex
  9. ( ) CSS Pre-processors
  10. (*) Linter / Formatter
  11. ( ) Unit Testing
  12. ( ) E2E Testing

tips: 安装vgc辅助快捷工具
https://www.zybuluo.com/mdeditor#1055583

以前总喜欢把通用的部分抽出来,比如头部。 如果用Muse-ui,就不用了。先开发,后续再考虑

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注