随笔分类 -  vue

vue vue
摘要:1 循环块 (表头动态变化 / 多个规律label) <el-table-column v-for="item in ['1','2','3']" :key="item" :label="item" prop="noticeType"> </el-table-column> 2 多个数组生成法 Ar 阅读全文
posted @ 2019-12-26 10:39 justSmile2 阅读(569) 评论(0) 推荐(0) 编辑
摘要:slot 内容分发 插槽内可以包含任何模板代码(html 组件) 父级模板里的所有内容都是在父级作用域中编译的;子模板里的所有内容都是在子作用域中编译的。 1. html 组件 Vue.component('alert-box', { template: ` <div class="demo-ale 阅读全文
posted @ 2019-12-25 17:00 justSmile2 阅读(1665) 评论(0) 推荐(0) 编辑
摘要:1. element-ui 日期选区禁用,设置属性 disabledDate: (time) => { const curDate = (new Date()).getTime() const day = 10 * 24 * 3600 * 1000 const dateRegion = curDat 阅读全文
posted @ 2019-10-17 19:58 justSmile2 阅读(379) 评论(0) 推荐(0) 编辑
摘要:1. 组合 label <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <!-- import CSS --> <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/the 阅读全文
posted @ 2019-08-07 23:43 justSmile2 阅读(170) 评论(0) 推荐(0) 编辑
摘要:<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <div id="app"> <input type="text" @input="deboun 阅读全文
posted @ 2019-08-01 23:00 justSmile2 阅读(273) 评论(0) 推荐(0) 编辑
摘要:0.Vue Router 是Vue官方的路由管理器。它和 Vue.js 的核心深度集成,让构建单页面应用变得易如反掌。vue-router 默认 hash 模式,还有一种是history模式。 hash模式的工作原理是hashchange事件,可以在window监听hash的变化。 HTML5新增的 阅读全文
posted @ 2019-07-29 21:27 justSmile2 阅读(152) 评论(0) 推荐(0) 编辑
摘要:1.vue-resource对比axios 文章1 文章2 1.0 axios params 配置参数在url 显示,form-data 用于 图片上传、文件上传 1.1 axios 全局配置 axios.defaults.baseURL=‘http:localhost:8080’ 1.2 axio 阅读全文
posted @ 2019-07-11 23:36 justSmile2 阅读(339) 评论(0) 推荐(0) 编辑
摘要:1.vuex 是一个专门为vue.js应用程序开发的状态管理模式( 一般由 main.js 引入,是全局数据:用于组件间通信的 共享数据) 2. 关键对象 state:存储状态(变量)/ 状态树 (包含所有需要共享的资源) getters:对数据获取之前的再次编译(简化原始状态数 state),可以 阅读全文
posted @ 2019-07-06 22:39 justSmile2 阅读(192) 评论(0) 推荐(0) 编辑
摘要:1. node 安装版本 9+ 2. 命令行 创建方式 vue create project 3. 可视化 创建方式 vue ui 4. 扩展 goole 下 vue 调试工具安装 git 资源 https://github.com/vuejs/vue-devtools.git 步骤: 下载资源 - 阅读全文
posted @ 2019-06-08 14:13 justSmile2 阅读(382) 评论(0) 推荐(0) 编辑
摘要:1. 组件化 (父子组件通信: 父 - 子 :props 数组 子 - 父 : 子层触发事件,调用 $emit 触发父层对应自定义事件,可函数处理传参 / $event 获取) html <!DOCTYPE html> <html lang="en"> <head> <meta charset="U 阅读全文
posted @ 2019-06-03 11:02 justSmile2 阅读(349) 评论(0) 推荐(0) 编辑
摘要:1.数组列表 v-for 块中,我们拥有对父作用域属性的完全访问权限。v-for 还支持一个可选的第二个参数为当前项的索引 1.1 普通渲染 v-for="item in items" / v-for="item of items" / v-for="item of items":key="item 阅读全文
posted @ 2019-05-21 18:19 justSmile2 阅读(189) 评论(0) 推荐(0) 编辑
摘要:1.要点 1.1 v-if 条件性地渲染一块内容 <h1 v-if="awesome">Vue is awesome!</h1> 附带 / v-else / v-else-if <h1 v-if="awesome">Vue is awesome!</h1> <h1 v-else>Oh no 😢</ 阅读全文
posted @ 2019-05-20 15:30 justSmile2 阅读(1020) 评论(0) 推荐(0) 编辑
摘要:1. Class 绑定 1.1 对象语法 普通对象 单个类 <div v-bind:class="{ active: isActive }"></div> 普通对象 多个类 <div class="static" v-bind:class="{ active: isActive, 'text-dan 阅读全文
posted @ 2019-05-20 15:04 justSmile2 阅读(155) 评论(0) 推荐(0) 编辑
摘要:1. 计算属性 用于简单运算的。在模板中放入太多的逻辑会让模板过重且难以维护 (fullname instead of {{ a+b}} or {{a}}{{b}}) 计算属性是基于它们的响应式依赖进行缓存的。只在相关响应式依赖发生改变时它们才会重新求值 ( 效率高,节省性能 ) 调用方法将总会再次 阅读全文
posted @ 2019-05-20 11:45 justSmile2 阅读(163) 评论(0) 推荐(0) 编辑
摘要:1. 要点 Vue.js 使用了基于 HTML 的模板语法 也可以不用模板,直接写渲染 (render) 函数,使用可选的 JSX 语法 2. 细节点 2.1 插值 2.1.1 文本 “Mustache”语法 (双大括号) {{ msg }} <span>Message: {{ msg }}</sp 阅读全文
posted @ 2019-05-17 16:59 justSmile2 阅读(541) 评论(0) 推荐(0) 编辑
摘要:0. 知识点 // data 对象中的所有的属性加入到 Vue 的响应式系统中 // 只有当实例被创建时 data 中存在的属性才是响应式的 // 阻止修改现有的属性 Object.freeze() // 暴露了一些有用的实例属性与方法。它们都有前缀 $ vm.$data vm.$el vm.$wa 阅读全文
posted @ 2019-05-14 18:00 justSmile2 阅读(170) 评论(0) 推荐(0) 编辑
摘要:1. 概念 Vue (读音 /vjuː/,类似于 view) 是一套用于构建用户界面的渐进式框架。能够为复杂的单页应用提供驱动。 2. 用法 2.1 声明式渲染 2.1.1 改变文本 {{ message }} 打开你的浏览器的 JavaScript 控制台 (就在这个页面打开),并修改 app.m 阅读全文
posted @ 2019-05-08 17:06 justSmile2 阅读(367) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示