vue-quill-editor(CDNで)
問題
vue-quill-editor、CDN環境だとどうやって使うの?
答え
こんな感じでWYSIWYGエディタが動きます。
HTML
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <title>vue-quill-editor(CDNで)</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/quill@1.3.6/dist/quill.core.css"/> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/quill@1.3.6/dist/quill.snow.css"/> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/quill@1.3.6/dist/quill.bubble.css"/> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/quill@1.3.6/dist/quill.min.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vue-quill-editor@3.0.6/dist/vue-quill-editor.js"></script> <script> Vue.use(VueQuillEditor) </script> </head> <body> <div id="app" class="container"> <h1>vue-quill-editor Demo</h1> <p>vue-quill-editor のデモです。</p> <quill-editor v-model="content" ref="quillEditor" options="editorOption" ></vue-quill-editor> </div> <script> new Vue({ el: '#app', data: { content: '<h1>テストです</h1><p>Hellow contents</p>', editorOption: { theme: 'snow' } } }); </script> </body> </html>
デモ
https://www.softel.co.jp/blogs/tech/archives/demo/vue-quill-editor-demo
コメント