GAJYA的个人博客


  • 首页

  • 标签

  • 分类

  • 归档

vue 组件调用组件报错:did you register the component correctly?

发表于 2019-05-06 | 阅读次数:

一般报这个错的原因都是我们使用了未注册的组件。

Vue.js 提供了 2 种组件的注册方式,全局注册和局部注册。

  1. 先引入(确保路径没问题)
  2. components注册
  3. 引入的组件保持name一致
阅读全文 »

使用饿了么表单报错,提示filed命名冲突

发表于 2019-04-28 | 分类于 前端 , vue , 工具 | 阅读次数:

饿了么表单报错,vee-validate的(filed)命名冲突

原因可能是项目使用了vee-validate,请自行检查,如果是,解决方法如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
main.js

// 饿了么表单报错,vee-validate的命名冲突,利用自定义vee-validate配置解决这个问题
const config = {
aria: true,
classNames: {},
classes: false,
delay: 0,
dictionary: null,
errorBagName: 'errors', // change if property conflicts
events: 'input|blur',
fieldsBagName: 'fields2', // 把这个名字改成fields之外的就可以了
i18n: null, // the vue-i18n plugin instance
i18nRootKey: 'validations', // the nested key under which the validation messages will be located
inject: true,
locale: 'en',
validity: false,
useConstraintAttrs: true
};

//vue安装插件时候,传入配置
Vue.use(VeeValidate, config);

可以利用自定义vee-validate配置解决这个问题,在main.js里加入config配置项

mpvue打包没有.json等配置文件的解决方法

发表于 2019-03-07 | 分类于 前端 , 小程序 | 阅读次数:

情况1

使用vue init mpvue/mpvue-quickstart my-project 初始化项目却报找不到app.json

解决办法

出错原因:版本问题,最新版本的mpvue 构建出来的代码在 dist/wx 下面

project.config.json里miniprogramRoot 改成 dist/wx/

GitHub PR

阅读全文 »

性能优化———浏览器存储

发表于 2019-03-05 | 阅读次数:

test-post

发表于 2019-03-05 | 阅读次数:

test-post

测试hexo插入图片

阅读全文 »

["1", "2", "3"].map(parseInt) 为何返回[1,NaN,NaN]

发表于 2019-02-18 | 分类于 前端 , javascript , es6 | 阅读次数:

[“1”, “2”, “3”].map(parseInt) 为何返回[1,NaN,NaN]

1
2
3
4
5
6
7
8
9
["1", "2", "3"].map(parseInt)

// 相当于
['1','2','3'].map((value, index) => {
return parseInt(value, index)
})
// 第一轮遍历 parseInt('1', 0) -> 1
// 第二轮遍历 parseInt('2', 1) -> NaN
// 第三轮遍历 parseInt('3', 2) -> NaN

parseInt(string, radix) 的参数radix必须介于2~36之间,而且字符串string中的数字不能大于radix才能正确返回数字结果值。

阅读全文 »

什么是NPM

发表于 2019-01-22 | 分类于 前端 , node | 阅读次数:

什么是NPM

NPM(node package manager),通常称作node包管理器,主要功能就是管理node包,包括:安装、卸载、更新、查看、搜索、发布等。

NPM是基于couchdb一个数据库,详细记录了每个包的信息(作者、版本、依赖、授权信息等)。

NPM官网

阅读全文 »

class类

发表于 2018-12-29 | 分类于 前端 , javascript , es6 | 阅读次数:

class类

constructor方法

constructor方法是类的默认方法,通过new命令生成对象实例时,自动调用该方法。一个类必须有constructor方法,如果没有显式定义,一个空的constructor方法会被默认添加。

如果定义了一个空的类Point,Javascript引擎会自动为它添加一个空的contructor方法。

contructor方法默认返回实例对象(即this),完全可以指定返回另外一个对象。

阅读全文 »

Array数组扩展

发表于 2018-12-29 | 分类于 前端 , javascript , es6 | 阅读次数:

Array数组扩展

解构赋值

Array.from

Array.from方法用于将两类对象转为真正的数组:类似数组的对象(array-like object)和可遍历(iterable)的对象(包括 ES6 新增的数据结构 Set 和 Map)

阅读全文 »

async函数

发表于 2018-12-29 | 分类于 前端 , javascript , es6 | 阅读次数:

async函数

它就是Generator函数的语法糖。

Generator 函数,依次读取两个文件。

阅读全文 »
1234
GAJYA

GAJYA

We lie best when we lie to ourselves!

33 日志
14 分类
14 标签
RSS
Links
  • Vue技术内幕
  • Vue.js 技术揭秘
© 2020 GAJYA

Dose the walker choose the path, or the path the walker?