How to Create a Vue.Js App with VS Code and Deploy...
Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
In this post I would like to show you how create a Vue.js app with VS Code and how to deploy it SAP Netweaver.
As you probably already know, you can do Fiori development with Visual Studio Code and you can easily deploy it to SAP. So instead of Web IDE you can use VS Code. Here is a blog post for VSCode Fiori development.
SAP lets you use any javascript framework for your developments. It suggests to use Fiori but you are definitely not limited to Fiori. And in this short post, I will show you how to create a Vue.js app and how to run it from SAP, as same as you would do with Fiori.
And I will create another blog post to show you, how you can create a rest web api with abap and consume it with vue app. So instead of oData and Fiori, you can use faster approach for creating backend services and Vue to create interface.
Open a terminal window again and go to your workspace folder to create the app and app folder with following command. And choose V3.
vue create vue-abap-app
if you get following error -> File C:\Users\xxx\AppData\Roaming\npm\vue.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see
Run Set-ExecutionPolicy RemoteSigned and re-try vue create vue-abap-app
This time you should see new folder and files in your workspace.
Now you can run Vue app. Go to vue-abap-app folder and run.
cd .\vue-abap-app\
npm run serve
You can open a browser and enter following URLS to reach Vue app.
Before we build and deploy we need to make sure, we provide production path for source files. Our app will be running on SAP with URL address of 'http://127.0.0.1:8000/sap/bc/ui5_ui5/sap/zvueabapapp/index.html?sap-client=001'. We need to tell vue to look sources under '/sap/bc/ui5_ui5/sap/zvueabapapp/'. Open vue config.js and add following code.
Very simply you can do Vue development and publish it to SAP Netweaver.
In next post, I will show how to create a rest api with abap and use it with vue. I personally don't like oData. I think rest is much more practical and easier to develop and extend. Read my blog on MVC1 applied rest api. And unfortunately same is true for Fiori. Vue is much more elegant and easier to understand and develop compare to Fiori. Therefore if I can choose one, I will choose Rest + Vue combination.