摘要: relative:位置通过top,right,bottom,left这4个定位偏移属性进行偏移。 注:其他的对象如果设置了悬浮,会保留设置了relative 的对象宽度的位置(对象未脱离文本流),如果4个偏移量设置不正确会导致元素重叠。 static:设置了position: static,4个偏移 阅读全文
posted @ 2018-04-07 13:32 tony_zhu 阅读(132) 评论(0) 推荐(0) 编辑
摘要: css (Cascading Style Sheet) 层叠样式表/级联样式表 属性选择器 [ ] [attr]: 所有包含attr 属性名的 标签将会被选中 e.g: [id] 所有存在id属性的标签将会被应用该css 样式 [attr='value']: 属性值全匹配值 e.g <div cla 阅读全文
posted @ 2018-04-06 15:35 tony_zhu 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 数据绑定内支持JavaScript表达式:string字符串反转用.隔开 js: msg:'Hello ' html: {{ msg.split('').reverse().join('.') }} computed 定义计算属性 太多的逻辑会让模板过重且难以维护,用于计算复杂算法 绑定多个clas 阅读全文
posted @ 2018-03-05 14:23 tony_zhu 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 全局安装或更新WePY命令行工具 在开发目录中生成Demo开发项目 切换至项目目录 开启实时编译 VS Code语法支持 1. 在 Code 里先安装 Vue 的语法高亮插件 Vetur。 2. 打开任意 .wpy 文件。 3. 点击右下角的选择语言模式,默认为纯文本。 4. 在弹出的窗口中选择 . 阅读全文
posted @ 2018-01-16 15:26 tony_zhu 阅读(582) 评论(0) 推荐(0) 编辑
摘要: 1.在 xx.html 中直接 写标签 <a [routerLink]="['/home']">home</a> 2.在 xx.html 中 触发click事件 <button class="btn btn-primary" (click)="Login()">Submit</button> 在xx 阅读全文
posted @ 2017-12-13 15:42 tony_zhu 阅读(2317) 评论(0) 推荐(0) 编辑
摘要: 1.在xx.ts中引入css样式无效 @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) 解决:去除 styleUrls中的 ./ 阅读全文
posted @ 2017-12-13 10:53 tony_zhu 阅读(633) 评论(0) 推荐(0) 编辑
摘要: 1.cnpm install ngx-bootstrap bootstrap --save ※可能缺少jquery cnpm i jquery 2. 打开 angular-cli.json (项目根目录下) style 节点 增加 "styles": [ "../node_modules/boots 阅读全文
posted @ 2017-12-13 10:46 tony_zhu 阅读(1199) 评论(0) 推荐(0) 编辑
摘要: 目的:为了不再把相同的代码复制一遍又一遍,我们要创建一个单一的可复用的数据服务,并且把它注入到需要它的那些组件中。 ※ 文件命名约定:服务名称的小写形式(基本名),加上.service后缀,如果服务名称包含多个单词,我们就把基本名部分写成中线形式 (dash-case)。 1.新建服务 xx.ser 阅读全文
posted @ 2017-12-07 14:57 tony_zhu 阅读(133) 评论(0) 推荐(0) 编辑
摘要: angular/cli 安装 ♦ npm uninstall -g angular-cli /cnpm install -g angular-cli ※采用npm安装失败: Missing write access to XXXXXX.. ♦ 安装成功后 cd 项目目录 ♦ cnpm i 安装依赖 阅读全文
posted @ 2017-12-06 15:06 tony_zhu 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 1.遇到页面显示不更新,数据已更新情况 vue-cli中: this.$nextTick(function () { this.x=x; }) 以js引入vue的网页中: this.$set(this.data, index, { nodeId: id, . . . }); 2.在vue 1.x系列 阅读全文
posted @ 2017-12-06 14:01 tony_zhu 阅读(1493) 评论(0) 推荐(0) 编辑