Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // test.vue
- <template>
- <h1> Test Render</h1>
- </template>
- <script>
- export default {
- }
- </script>
- <style scoped>
- </style>
- // app.js
- import Vue from 'vue'
- import test from './component/test.vue'
- new Vue({
- el: '#app',
- render: h => h(test)
- })
- // index.html
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <title>Vue Testing</title>
- <!-- Javascript -->
- <script src="https://cdn.jsdelivr.net/npm/vue"></script>
- </head>
- <body>
- <div id="app">
- </div>
- <script src="(( url_for('static', filename='js/app.js') ))"></script>
- </body>
- </html>
- // app.py
- from flask import Flask, render_template
- from flask_cors import CORS
- class CustomFlask(Flask):
- jinja_options = Flask.jinja_options.copy()
- jinja_options.update(dict(
- block_start_string='{%',
- block_end_string='%}',
- variable_start_string='((',
- variable_end_string='))',
- comment_start_string='{#',
- comment_end_string='#}',
- ))
- app = CustomFlask(__name__)
- CORS(app)
- @app.route('/')
- def index():
- return render_template('index.html')
- if __name__ == '__main__':
- app.run(debug=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement