摘要: https://v3.cn.vuejs.org/api/refs-api.html#ref // 官网地址 阅读全文
posted @ 2020-12-04 14:56 阿凡达的小驴 阅读(981) 评论(0) 推荐(0)
摘要: 在父组件给孙组件传值时,没有通过props注册的属性,可通过$attrs取到没注册的属性值,简化父组件和孙组件的传值 阅读全文
posted @ 2020-12-03 16:13 阿凡达的小驴 阅读(84) 评论(0) 推荐(0)
摘要: 1.字符串、数字(通过ref实现) <template> <button @click="add">{{ num }}</button> </template> <script lang="ts"> import { defineComponent, ref } from 'vue' export 阅读全文
posted @ 2020-10-27 19:33 阿凡达的小驴 阅读(515) 评论(0) 推荐(0)
摘要: html <div v-setcolor="red" ></div> 1.vue2.0写法 Vue.directive('setcolor', { bind(el, binding, vnode) { el.style.color = binding } }) 2.vue3.0写法(beforeMo 阅读全文
posted @ 2020-10-27 19:12 阿凡达的小驴 阅读(846) 评论(0) 推荐(0)
摘要: 1.user-select属性 user-select: none : 元素和子元素的文本将无法被选中 user-select: text : 文本可以被选中(默认值) user-select: auto : 文本将根据浏览器的默认属性进行选择 user-select: all : 当所有内容作为一 阅读全文
posted @ 2020-10-27 18:03 阿凡达的小驴 阅读(995) 评论(0) 推荐(0)
摘要: 1.创建fonts文件,将要自定义字体的文件放入文件夹 2.在app中通过@font-face引入自定义字体 @font-face { font-family: '自定义名字' //自定义字体的名字 src: './fonts/文件名','./fonts/文件名1' ..... // 要使用字体的路 阅读全文
posted @ 2020-10-23 11:55 阿凡达的小驴 阅读(392) 评论(0) 推荐(0)
摘要: display:table-cell可实现大小不定的元素垂直居中,margin设置会失效,对padding的使用无影响 div { display: table-cell; vertical-align: middle; } 使用display:table时,table的padding设置会失效; 阅读全文
posted @ 2020-09-03 18:17 阿凡达的小驴 阅读(190) 评论(0) 推荐(0)
摘要: input::-webkit-input-placeholder{ color:red; font-size:20px; } 阅读全文
posted @ 2020-08-31 11:50 阿凡达的小驴 阅读(185) 评论(0) 推荐(0)
摘要: 1.创建服务器 var http = require('http'); http.createServer((require,response) => { response.end('hello world') }).listen(8888); console.log('启动服务器成功'); 2.启 阅读全文
posted @ 2020-08-27 19:07 阿凡达的小驴 阅读(140) 评论(0) 推荐(0)
摘要: require.resolve('相对路径') 该方法会将相对路径拼接生成一个绝对路径,并自动检验该路径是否存在 阅读全文
posted @ 2020-08-26 15:08 阿凡达的小驴 阅读(1747) 评论(0) 推荐(0)