开发中记录的一些知识点

ppylox
·2/16/2021·0 阅读
AI 摘要模型根据正文自动生成,仅供参考

本文汇总开发中的实用技巧:Vue父子组件可通过this.$parent.func()和this.$children.func()相互调用;JS四舍五入用Math.round(num*100)/100;打开新窗口可用location.href配合window.open或直接window.open指定参数;Vue中通过@submit.native.prevent阻止Element表单默认提交。

\n

vue 父子组件相互调用: this.$parent.func(),this.$children.func()

\n\n\n\n

js四舍五入: Math.round(100.3.1415926 * 100) / 100

\n\n\n\n

js打开新窗口:

\n\n\n\n

1、location.href = "javascript: window.open('http://www.dsiab.com', 'newwindow', height=768,width=1366,top=0,left=0)"

\n\n\n\n

2、window.open("http://www.dsiab.com", "_blank", "toolbar=yes, status=no,height=768,height=400")

\n\n\n\n

vue中通过@submit.native.prevent 阻止element form表单默认提交

\n

相关文章

评论 (0)

暂无评论,来写第一条吧