上一页 1 ··· 4 5 6 7 8 9 10 11 下一页
摘要: 在实际的开发过程中,给表单元素绑定model的时候,绑定的元素的属性是根据后台数据动态生成的。如果使用常规的赋值方式,是无法更新视图的 需要使用, this.$set(dataName,keyName,keyValue) export default { data:{ // 先定义一个空对象 for 阅读全文
posted @ 2020-07-22 11:10 荣光无限 阅读(5269) 评论(0) 推荐(0) 编辑
摘要: 子组件vue <template> <div> <slot v-if="slots.header" name="header"></slot> <slot></slot> <slot name="footer"></slot> </div> </template> <script> export d 阅读全文
posted @ 2020-07-22 11:07 荣光无限 阅读(1497) 评论(0) 推荐(0) 编辑
摘要: 官方链接 https://cn.vuejs.org/v2/guide/components-custom-events.html#sync-修饰符 这个解释有点不太直观,用代码解释一下 ####父组件 v-bind:msg.sync="testMsg" <template> <div> <bizCo 阅读全文
posted @ 2020-07-22 11:05 荣光无限 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 父组件使用子组件时,使用v-model指令,在子组件中使用value获取props的值 父组件 <template> <div style="margin:20px;display:flex;align-items:center;"> <!-- 🚀 给子组件绑定v-model --> <bizCo 阅读全文
posted @ 2020-07-22 11:03 荣光无限 阅读(7678) 评论(0) 推荐(0) 编辑
摘要: 目的:插槽内容能够访问子组件中才有的数据是很有用的 父组件 <template> <div> <h1>作用域插槽: 绑定在<slot>;元素上的attribute被称为插槽Prop</h1> <slot-context> <h3>默认插槽: defalut slot content</h3> <!- 阅读全文
posted @ 2020-07-22 11:02 荣光无限 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 同级目录下 文件1 // exportByModule.js const hello_1 = () => { console.info('hello_1') } const hello_2 = () => { console.info('hello_2') } module.exports = { 阅读全文
posted @ 2020-07-22 10:59 荣光无限 阅读(1359) 评论(0) 推荐(0) 编辑
摘要: babel插件只是去唤醒 @babel/core中的转换过程 转换模块需要手动安装 npm install @babel/core 转换方式需要安装 @babel/preset-env babel默认只是ECMASCript的转换平台,平台是不做任何事情的,只是提供一个环境,具体工作的babel内部 阅读全文
posted @ 2020-07-22 10:57 荣光无限 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 定义一个带参数和默认值的mixin class // demo.scss @mixin button($background:#606266) { font-size: 1em; padding: 0.5em 1.0em; text-decoration: none; color: #fff; ba 阅读全文
posted @ 2020-07-22 10:43 荣光无限 阅读(660) 评论(0) 推荐(0) 编辑
摘要: class【serious-error】会继承 【error】的所有属性 .error { border: 1px solid red; background-color: #fdd; } .serious-error { @extend .error; font-size: 24px; } 阅读全文
posted @ 2020-07-22 10:41 荣光无限 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 屏幕宽度 小于等于 500px时 ⇒ #409EFF 屏幕宽度 大于 500px && 小于1024px时 ⇒ #67C23A 屏幕宽度 大于等于 1024px时 ⇒ #F56C6C @media (max-width: 500px) { .container { background: #409E 阅读全文
posted @ 2020-07-22 10:38 荣光无限 阅读(816) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 下一页