vue 使用ref *** 作dom

vue 使用ref *** 作dom,第1张

概述<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Docum <!DOCTYPE HTML> <HTML lang="en"> <head> <Meta charset="UTF-8"> <Meta name="vIEwport" content="wIDth=device-wIDth,initial-scale=1.0"> <Meta http-equiv="X-UA-Compatible" content="IE=edge"> <Title>document</Title> </head> <script src="https://cdn.bootCSS.com/vue/2.6.10/vue.Js"></script>
<body> <div ID="app"> <h3 ref="myh3">{{name}}</h3> </div> <script> var vm = new Vue({ el:‘#app‘, data:{ name:‘1‘ }, methods: {   }, mounted () { this.$refs.myh3.style.color=‘red‘ } }); </script> </body> </HTML> 总结

以上是内存溢出为你收集整理的vue 使用ref *** 作dom全部内容,希望文章能够帮你解决vue 使用ref *** 作dom所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1057770.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存