Demo 在线地址:
https://sx00xs.github.io/test/31/index.html
---------------------------------------------------------------
ide: vscode
文件格式:.vue
解析:(待补)
<template> <pre v-pre> <script type="text/javascript"> var i = iResult = 0 function sum() { for (var i = 0; i < arguments.length; i++) { iResult += arguments[i] } return iResult } <span>//应用</span> alert(sum(1,2,3,4,5,6,7,8,9,10)) <span>//输出55</span> </script> </pre> </template> <script> export default { methods:{ sum(){ var result=0; for(var i=0;i<arguments.length;i++) { result += arguments[i]; } return result; } }, mounted(){ alert(this.sum(1,2,3,4,5,6,7,8,9,10)) } } </script>