2021-1-23用来记录

一级目录

路由history模式下


const router = new VueRouter({
  // 可以在切换路由时回到顶部
  scrollBehavior: () => ({ x: 0, y: 0 }),
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [...routes, ...routerMap],
});

webpack之proxyTable设置跨域

proxyTable: {
      '/api': {
        target: 'http://www.zj.com/', // 接口域名
        changeOrigin: true, // 是否跨域
        pathRewrite: {
          '^/api': '/index/index', // 需要rewrite重写
        },
      },
    },

aynsc 返回一个promise对象,返回promise对象本身

一些配置

/*  prettier的配置 */
{
  // 超过最大值换行
  "printWidth": 120,
  // 缩进字节数
  "tabWidth": 2, 
  // 缩进不使用tab,使用空格
  "useTabs": false, 
  // 句尾添加分号
  "semi": true,
  // 使用单引号代替双引号
  "singleQuote": true, 
  // 默认值。因为使用了一些折行敏感型的渲染器(如GitHub comment)而按照markdown文本样式进行折行
  "proseWrap": "preserve",
  //  (x) => {} 箭头函数参数只有一个时是否要有小括号。avoid:省略括号
  "arrowParens": "avoid", 
  // 在对象,数组括号与文字之间加空格 "{ foo: bar }"
  "bracketSpacing": true, 
  // 不格式化vue文件,vue文件的格式化单独设置
  "disableLanguages": ["vue"], 
  // 结尾是 \n \r \n\r auto
  "endOfLine": "auto", 
  //不让prettier使用eslint的代码格式进行校验
  "eslintIntegration": false, 
  "htmlWhitespaceSensitivity": "ignore",
  // 不使用prettier格式化的文件填写在项目的.prettierignore文件中
  "ignorePath": ".prettierignore", 
  // 在jsx中把'>' 是否单独放一行
  "jsxBracketSameLine": false,
  // 在jsx中使用单引号代替双引号
  "jsxSingleQuote": false, 
  // 格式化的解析器,默认是babylon
  "parser": "babylon", 
  // Require a 'prettierconfig' to format prettier
  "requireConfig": false, 
  //不让prettier使用stylelint的代码格式进行校验
  "stylelintIntegration": false, 
  // 在对象或数组最后一个元素后面是否加逗号(在ES5中加尾逗号)
  "trailingComma": "es5", 
  // 不让prettier使用tslint的代码格式进行校验
  "tslintIntegration": false 
}

vue路由跳转报错路由重复 Avoided redundant navigation to current location


const VueRouterPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch((err) => err);
};

van-button阻止冒泡

在这里插入图片描述
https://github.com/youzan/vant-weapp/issues/3473

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值