摘要: 绑定事件监听器(v-on) 事件系统是前端开发非常重要的内容,vue 对其进行了封装和扩展,使用起来更加的方便。 vue 官网对其指令介绍:https://cn.vuejs.org/api/built-in-directives.html#v-on 给元素绑定事件监听器。 Vue 使用指令 v-on 阅读全文
posted @ 2023-01-28 23:52 左扬 阅读(316) 评论(0) 推荐(0) 编辑
摘要: Class 与 Style 绑定(绑定内联样式) 一、绑定对象 :style支持绑定 JavaScript 对象值,对应的是HTML 元素的style属性: template: const activeColor = ref('red') const fontSize = ref(30) templ 阅读全文
posted @ 2023-01-28 23:25 左扬 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Class 与 Style 绑定(绑定 HTML CLASS) 数据绑定的一个常见需求场景是操纵元素的 CSS class 列表和内联样式(称为行内样式、行间样式,是通过标签的 style 属性来设置)。因为class和style都是 attribute,我们可以和其他 attribute 一样使用 阅读全文
posted @ 2023-01-28 22:16 左扬 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 属性绑定(v-bind) 动态的绑定一个或多个 attribute,也可以是组件的 prop。 缩写:: 或者 . (当使用 .prop 修饰符) 期望:any(带参数)| Object(不带参数) 参数:attrOrProp(可选的) 修饰符: .camel- 将短横线命名的attribute转变 阅读全文
posted @ 2023-01-28 21:53 左扬 阅读(245) 评论(0) 推荐(0) 编辑
levels of contents