把三个文件放到一个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>Document</title>
    <link rel="stylesheet" href="../../frame/bootstrap/css/bootstrap.min.css">
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
        #editor {
            margin: 0;
            height: 100%;
            font-family: "Helvetica Neue", Arial, sans-serif;
            color: #333;
            }
        
        #editor div {
            display: inline-block;
            width: 49%;
            height: 100%;
            vertical-align: top;
            box-sizing: border-box;
            padding: 0 20px;
            }

        textarea {
            border: none;
            border-right: 1px solid #ccc;
            resize: none;
            outline: none;
            background-color: #f6f6f6;
            font-size: 14px;
            font-family: "Monaco", courier, monospace;
            padding: 20px;
            }

        code {
            color: #f66;
            }
    </style>
    
</head>

<body>
    <div id="editor">
        <textarea :value="input" @input="update"></textarea>
        <div v-html="compiledMarkdown"></div>
    </div>

    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <script>
       const app = Vue.createApp({
           data() {
               return {
                   input: '# hello'
                   }
                   },
           computed: {
               compiledMarkdown() {
                   return marked(this.input, { sanitize: true });
                }
            },
            methods: {
                update: _.debounce(function(e) {
                    this.input = e.target.value;
                }, 300)
            }
        })
        
       app.mount('#editor')

    </script>
</body>

</html>

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 1024 设计师:白松林 返回首页