摘要: 1.安装vue-validator插件 npm install vue-validator 因为vue-validator是Vue.js的一个插件,所以vue-validator需要使用Vue.use(PluginContructor)(Vue.js用此方法来注册该插件) 在main.js中注册该插 阅读全文
posted @ 2019-12-09 22:27 LPEIL 阅读(2237) 评论(0) 推荐(0) 编辑
摘要: filter:过滤器,基本的概念这里就不再复述,官方文档很详细 全局使用filter: 新建一个filter.js文件 const filters = { reverseMsg:msg=> msg+',this is filter', concatMsg:msg=>msg+',this is fil 阅读全文
posted @ 2019-12-09 16:47 LPEIL 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 使用场景:当组件层级较深,然后需要使用到根组件中的某些值,就需要使用到依赖注入 依赖注入的基本内容就是关于 provide 和 inject 根组件中使用provide export default { name: 'app', data(){ return { msg:'Welcome to Yo 阅读全文
posted @ 2019-12-09 12:00 LPEIL 阅读(613) 评论(0) 推荐(1) 编辑