上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 63 下一页
摘要: 捕获同步异常: created() { this.test1() }, methods: { test1() { try { this.test2() } catch (err) { console.warn('捕获到test2的错误', err) } }, test2() { throw new 阅读全文
posted @ 2021-10-09 16:59 吴小明- 阅读(275) 评论(0) 推荐(0) 编辑
摘要: async created() { // Promise.all([this.getTodos(), this.getComments(), this.getAlbums()]).then( // (res) => { // console.log(res) // } // ) const data 阅读全文
posted @ 2021-10-09 16:08 吴小明- 阅读(442) 评论(0) 推荐(0) 编辑
摘要: import axios from 'axios' export default { mounted() { // this.getTodos().then((res) => { // console.log('todos', res.data) // this.getComments().then 阅读全文
posted @ 2021-10-09 15:54 吴小明- 阅读(277) 评论(0) 推荐(0) 编辑
摘要: <template> <div id="app"> <button class="btn btn-primary">按钮1 <span class="mask mask-1"></span></button> <button class="btn btn-secondary">按钮2 <span c 阅读全文
posted @ 2021-10-09 15:15 吴小明- 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 一、原生js的方式: * { margin: 0; padding: 0; } body { height: 2000px; } .header { height: 100px; background-color: red; } .nav { line-height: 50px; backgroun 阅读全文
posted @ 2021-10-02 20:54 吴小明- 阅读(280) 评论(0) 推荐(0) 编辑
摘要: const a = [] for (i = 0; i < 100000; i++) { a.push({ id: i, name: 'xx' + i }) } const b = [] for (let i = 0; i < 100; i++) { b.push({ id: i, name: 'yy 阅读全文
posted @ 2021-09-29 21:56 吴小明- 阅读(753) 评论(0) 推荐(0) 编辑
摘要: <template> <div id="app"> <span @click="close">x</span> </div> </template> <script> export default { methods: { close() { console.log('123') } } } </s 阅读全文
posted @ 2021-09-25 19:40 吴小明- 阅读(176) 评论(0) 推荐(0) 编辑
摘要: [class^='icon'], [class*=' icon'] { width: 100px; height: 100px; background-color: red; } 以icon开头,包含 ' icon'的类名 阅读全文
posted @ 2021-09-25 19:32 吴小明- 阅读(708) 评论(0) 推荐(0) 编辑
摘要: 概念:当设置padding-bottom的值为75%时,该值为父级元素宽度的75%,可以达到自适应的效果 应用: <template> <div id="app"> <div class="img-container"><img src="./assets/images/4:3.jpg"></div 阅读全文
posted @ 2021-09-25 17:09 吴小明- 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 自定义loading指令 directives/MyLoading/index.vue: <template> <div class="loading-wrapper"> <div class="loading-content"> <img width="50" height="50" src="./loading.gif" 阅读全文
posted @ 2021-09-25 16:19 吴小明- 阅读(203) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 63 下一页