Is it possible to use VUE.js in Magento1 or Magento2 ?
Is any one used this, please share me example.
Thanks
Vishal
Solved! Go to Solution.
I did some research and found solution.
Write below code in your phtml file.
<html>
<head>
<title>VueJs Introduction</title>
<script type = "text/javascript" src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id = "intro" style = "text-align:center;">
<h1>{{ message }}</h1>
</div>
<script type = "text/javascript">
var vue_det = new Vue({
el: '#intro',
data: {
message: 'My first VueJS Task'
}
});
</script>
</body>
</html>
I did some research and found solution.
Write below code in your phtml file.
<html>
<head>
<title>VueJs Introduction</title>
<script type = "text/javascript" src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id = "intro" style = "text-align:center;">
<h1>{{ message }}</h1>
</div>
<script type = "text/javascript">
var vue_det = new Vue({
el: '#intro',
data: {
message: 'My first VueJS Task'
}
});
</script>
</body>
</html>
I think this is not a solution, since the CDN should not be used for any productive environment.
Also the issue of distribution files where you leave them?
This would only make it a more templating language, right?
@braulio_anastac wrote:I think this is not a solution, since the CDN should not be used for any productive environment.
Why we sould not use CDN for any productive environment?
I need to include Vue.js by CDN instead use Vue PWA Storefront
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js" type="text/javascript" defer></script>
But this doesn't work