Wordpress PHP variable to Vue Component -
i building wordpress theme , incorporate vue.js (2.0) it. need able pass variables wordpress vue, such page or post content. attempting return page content.
i attempted method didn't seem work either: pass php variable vue component instance
in page template have following:
<content inline-template :content="{{ $content }}"> <div id="content" class=""> </div> </content>
the component:
vue.component('content', { props: ['content'] }); new vue({ el: "#app" });
Comments
Post a Comment