Skip to content

1025623017/blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Murphy Leung 's Personal Blog

Go to my blog:http://1025623017.github.io/blog

Email to me

Web Front Tree Mindmap 01:https://raw.githubusercontent.com/1025623017/blog/master/Front_End_teee_01.png

Web Front Tree Mindmap 02:https://raw.githubusercontent.com/1025623017/blog/master/Front_End_teee_02.jpg

Edit this page

模具知识分享(Plastic Engineers,Mould Designers,Tooling Design Engineers)

我的产品(My Products)

购买我的GK产品

Go to my 3D Museum

Buy them in https://app.gumroad.com/products

To Be Continued...

前端知识分享(Front End)

vue图标Vux图标Vux开发分享

  • 安装(多次安装失败,请换台电脑试试)

      Vux项目已在2017年1月11日更新至2.0
      [https://github.com/airyland/vux](https://github.com/airyland/vux)
  • 配置

    • 详情请看项目Demo
  • 组件式开发

    日常添加路由,写.vue文件就可以了
    
    首先在main.js新增路由,然后在新页面中复制改写[demo](https://vux.li/demos/#/component/demo)中的代码即可
  • main.js文件中封装全局ajax

      // 全局ajax
      export function uAjax(init,_this) {
          var type = init.type
          var url = init.url
          var params = init.params
          var successFn = init.success
          var failFn = init.fail
          var showLoading = init.showLoading
          var closeLoading = init.closeLoading
    
          // 默认自带域名
          var urlDefault = init.urlDefault
    
          // 默认显示loading
          if (showLoading != false) {
              _this.showLoading = true
          }
    
          // 默认GET方法
          type = (type==null || type=="" || typeof(type)=="undefined")? "get" : type
    
          // 设置延时才会得到Vue.http.options.root
          setTimeout(() => {
              // 默认自带域名
              if (urlDefault != false) {
                  url = Vue.http.options.root+url
              }
              // 支持get/post/put方法
              if (type=='get') {
                  Vue.http.get(url,{params})
                  .then(response => {
                      if (response.data.code==0) {
                          successFn.call(this,response.data)
                      }else if(response.data.code==1){
                          if (failFn) {
                              failFn.call(this,response.data)
                          }
                      }else if(response.data.code==2){
                          _this.txtError = response.data.message
                          _this.showError = true
                          setTimeout(() => {
                              router.go('/login')
                          }, 1000)
                      }
                      console.warn(response)
                      // 默认关闭loading
                      if (closeLoading != false) {
                          _this.showLoading = false
                      }
                  },response => {
                      console.warn('请求错误')
                      console.warn(response)
                      _this.showLoading = false
                  })
                  .catch(console.log)
              }else if(type=='post'){
                  //
              }
          }, 500)
      }
  • yourfile.vue中调用封装的ajax

      //<script>直属部分
      import { uAjax } from 'src/main'
    
      //methods部分其中一个函数
      var _this = this
      uAjax({
        url: '/api/yourAPI/urlname',
        success: function(rsp) {
          _this.status = rsp.data.status
        }
        //省略参数...
      },this)
  • 项目示例

    • Vux商家入驻

我的前端项目

公司 & 任职经历

  • 深圳市友福同享信息科技有限公司(Wiki) 2016/06/12 ~ 2017/07/31
  • 模型工具店 2017/08/01 ~ 2099/08/01
  • 模具设计 2017/08/01 ~ 2099/08/01

科目

  • 语言(国语、英语、日语)
  • 数学(编程)
  • 历史地理政治(摄影、旅游)
  • 物理(模具设计)
  • 生物化学(日常运动、伤病急救、中西医)
  • 艺术(美术、音乐)

推荐网站


合作伙伴:

Bandai | Bandai Namco | CCSTOYS | 核诚治造 | 小号手模型 | 魔封真模型工作室

我的头像 Copyright © 2016-2024 Murphy Leung Powered By Github