vue.js with Django-webpack-loader

后端 未结 1 1987
天命终不由人
天命终不由人 2021-02-11 07:00

I want to use vue.js with Django but get stuck how to integrate vue in the Django templates.

I manage to make a bundle with webpack, setup vue with a piece of html which

1条回答
  •  名媛妹妹
    2021-02-11 07:24

    I noticed that the vue.js reference needs somehow to come after the vue html tags. Same applies when using Django-web-loader, so {% render_bundle 'main' %} needs to go down. This got it working:

    {% load staticfiles %}
    {% load render_bundle from webpack_loader %}
    
    
    
        
        Webpack Sample Project
    
    
    
    
    
    

    [[ message ]]

    kiekeboe {% render_bundle 'main' %}

    0 讨论(0)
提交回复
热议问题