摘要: let refList = ['a', 'b', 'c', 'd', 'e']; let choose = ['b', 'd', 'e']; let res = refList.filter( el => { return choose.indexOf(el)>-1 } ) console.log( 阅读全文
posted @ 2022-06-27 20:46 影随风舞 阅读(91) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-06-26 14:02 影随风舞 阅读(48) 评论(0) 推荐(0)
摘要: 1、需要定义一个标签标识为组件容器 #reportContainer <div id="report" #report> <div #reportContainer id="item"> </div> </div> 2、导入ViewContainerRef ,并导入需要动态插入的组件XXCompon 阅读全文
posted @ 2021-11-03 21:41 影随风舞 阅读(576) 评论(0) 推荐(0)
摘要: @ViewChild和@ViewChildren都是模板变量,前者是单一的,后者是以数组的形式存储 用法 1、在需要使用的标签上用#变量名标识一个标签 <div id="report" #report> <div #reportContainer id="item"> </div> </div> 2 阅读全文
posted @ 2021-11-03 21:35 影随风舞 阅读(450) 评论(0) 推荐(0)
摘要: 第一种采用,props和$emit 父组件 <template> <div class="home"> <img alt="Vue logo" src="../assets/logo.png"> <HelloWorld msg="Welcome to Your Vue.js App"/> <Hell 阅读全文
posted @ 2021-09-19 10:35 影随风舞 阅读(107) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-09-12 19:25 影随风舞 阅读(30) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Vue 组件</title> <script src="https://unpkg.com/vue@next"></script> </head> <body> <div id=" 阅读全文
posted @ 2021-09-12 19:22 影随风舞 阅读(33) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>基本模板指令</title> <script src="https://unpkg.com/vue@next"></script> </head> <body> <div id=" 阅读全文
posted @ 2021-09-12 19:21 影随风舞 阅读(37) 评论(0) 推荐(0)