• vsCode创建自己的代码模板


    配置地址参考如下:

    https://www.cnblogs.com/luzhanshi/p/12016281.html

    模板内容用自己下面这个:

    {
        "vue_learn_template":{
            "prefix": "vue",
            "body": [
                "<!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></title>",  
                " <style>",
                " </style>",
                "</head> ",
                "<body>",
                " <div id ="app">  ",
                " <h1>{{ msg }}</h1>  ",
                "  </div> ",
                " <script src="https://unpkg.com/vue@next"></script>",  
                " <script>",
                "  //创建Vue实例,得到 ViewModel",
                "  const app = Vue.createApp({",
                " data(){",
                " return {",
                " msg:'模板msg'",
                " }",
                " },",
                " methods: {",
                " getClass() {",
                " return [];",
                " }",
                " }",
                "  }).mount('#app');",
                " </script>",
                "</body> ",
                "</html>"
            ],
            "description": "vue学习时创建文件的模板" // 模板的描述
        }
    }
     
    模板生成html文件后的模板内容为:
    <!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></title>
        <style>
        </style>
    </head>

    <body>
        <div id ="app"> 

        <h1>{{ msg }}</h1> 

         </div>

        <script src="https://unpkg.com/vue@next"></script>
        <script>
         //创建Vue实例,得到 ViewModel
         const app = Vue.createApp({
            data(){
                return {
                    msg:'模板msg'
                }
                },
            methods: {
                getClass() {
                    return [];
                }
            }
         }).mount('#app');
        </script>
    </body>

    </html>
  • 相关阅读:
    eval命令的使用
    declare与typeset的使用
    【线型DP模板】最上上升子序列(LIS),最长公共子序列(LCS),最长公共上升子序列(LCIS)
    【线型DP】【LCS】UVA_10635 Prince and Princess
    【经典DP】洛谷 P2782 友好城市
    HDU-1051/POJ-1065 Wooden sticks 木棍子(动态规划 LIS 线型动归)
    BZOJ3659 Which Dreamed It
    CF300D Painting Square
    CF632E Thief in a Shop 和 CF958F3 Lightsabers (hard)
    CF528D Fuzzy Search 和 BZOJ4259 残缺的字符串
  • 原文地址:https://www.cnblogs.com/mamilaila/p/15181674.html
Copyright © 2020-2023  润新知